mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-13 22:16:03 +00:00
deps: Refactor dependencies (#3224)
* remove spring dep move junit, logging, mockito under dep mgmt * upgrade anti-corruption-layer deps * async method invocation * balking, bloc * bridge to bytecode * caching * callback - cqrs * component - health check * hexagonal - metadata mapping * rest of the patterns * remove checkstyle, take spotless into use
This commit is contained in:
1 parent
371439aeaa
commit
0ca162a55c
1863 files changed
+14403
-17632
No files matched your search
@@ -34,6 +34,14 @@
|
||||
</parent>
|
||||
<artifactId>business-delegate</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
|
||||
@@ -34,9 +34,9 @@ package com.iluwatar.business.delegate;
|
||||
* retrieved through service lookups. The Business Delegate itself may contain business logic too
|
||||
* potentially tying together multiple service calls, exception handling, retrying etc.
|
||||
*
|
||||
* <p>In this example the client ({@link MobileClient}) utilizes a business delegate (
|
||||
* {@link BusinessDelegate}) to search for movies in video streaming services. The Business Delegate
|
||||
* then selects the appropriate service and makes the service call.
|
||||
* <p>In this example the client ({@link MobileClient}) utilizes a business delegate ( {@link
|
||||
* BusinessDelegate}) to search for movies in video streaming services. The Business Delegate then
|
||||
* selects the appropriate service and makes the service call.
|
||||
*/
|
||||
public class App {
|
||||
|
||||
|
||||
+1
-3
@@ -26,9 +26,7 @@ package com.iluwatar.business.delegate;
|
||||
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* BusinessDelegate separates the presentation and business tiers.
|
||||
*/
|
||||
/** BusinessDelegate separates the presentation and business tiers. */
|
||||
@Setter
|
||||
public class BusinessDelegate {
|
||||
|
||||
|
||||
@@ -27,9 +27,7 @@ package com.iluwatar.business.delegate;
|
||||
import java.util.Locale;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Class for performing service lookups.
|
||||
*/
|
||||
/** Class for performing service lookups. */
|
||||
@Setter
|
||||
public class BusinessLookup {
|
||||
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
*/
|
||||
package com.iluwatar.business.delegate;
|
||||
|
||||
/**
|
||||
* MobileClient utilizes BusinessDelegate to call the business tier.
|
||||
*/
|
||||
/** MobileClient utilizes BusinessDelegate to call the business tier. */
|
||||
public class MobileClient {
|
||||
|
||||
private final BusinessDelegate businessDelegate;
|
||||
|
||||
@@ -26,9 +26,7 @@ package com.iluwatar.business.delegate;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* NetflixService implementation.
|
||||
*/
|
||||
/** NetflixService implementation. */
|
||||
@Slf4j
|
||||
public class NetflixService implements VideoStreamingService {
|
||||
|
||||
|
||||
+1
-3
@@ -24,9 +24,7 @@
|
||||
*/
|
||||
package com.iluwatar.business.delegate;
|
||||
|
||||
/**
|
||||
* Interface for video streaming service implementations.
|
||||
*/
|
||||
/** Interface for video streaming service implementations. */
|
||||
public interface VideoStreamingService {
|
||||
|
||||
void doProcessing();
|
||||
|
||||
@@ -26,9 +26,7 @@ package com.iluwatar.business.delegate;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* YouTubeService implementation.
|
||||
*/
|
||||
/** YouTubeService implementation. */
|
||||
@Slf4j
|
||||
public class YouTubeService implements VideoStreamingService {
|
||||
|
||||
|
||||
@@ -24,25 +24,22 @@
|
||||
*/
|
||||
package com.iluwatar.business.delegate;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
|
||||
/**
|
||||
* Tests that Business Delegate example runs without errors.
|
||||
*/
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/** Tests that Business Delegate example runs without errors. */
|
||||
class AppTest {
|
||||
|
||||
/**
|
||||
* Issue: Add at least one assertion to this test case.
|
||||
*
|
||||
* Solution: Inserted assertion to check whether the execution of the main method in {@link App}
|
||||
* throws an exception.
|
||||
* <p>Solution: Inserted assertion to check whether the execution of the main method in {@link
|
||||
* App} throws an exception.
|
||||
*/
|
||||
|
||||
@Test
|
||||
void shouldExecuteApplicationWithoutException() {
|
||||
|
||||
assertDoesNotThrow(() -> App.main(new String[]{}));
|
||||
assertDoesNotThrow(() -> App.main(new String[] {}));
|
||||
}
|
||||
}
|
||||
+6
-9
@@ -24,18 +24,15 @@
|
||||
*/
|
||||
package com.iluwatar.business.delegate;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
/**
|
||||
* Tests for the {@link BusinessDelegate}
|
||||
*/
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/** Tests for the {@link BusinessDelegate} */
|
||||
class BusinessDelegateTest {
|
||||
|
||||
private NetflixService netflixService;
|
||||
@@ -62,8 +59,8 @@ class BusinessDelegateTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* In this example the client ({@link MobileClient}) utilizes a business delegate (
|
||||
* {@link BusinessDelegate}) to execute a task. The Business Delegate then selects the appropriate
|
||||
* In this example the client ({@link MobileClient}) utilizes a business delegate ( {@link
|
||||
* BusinessDelegate}) to execute a task. The Business Delegate then selects the appropriate
|
||||
* service and makes the service call.
|
||||
*/
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user