mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-31 18:19:48 +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:
@@ -24,24 +24,21 @@
|
||||
*/
|
||||
package com.iluwatar.eda;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
|
||||
/**
|
||||
* Tests that Event Driven Architecture example runs without errors.
|
||||
*/
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/** Tests that Event Driven Architecture example runs without errors. */
|
||||
class AppTest {
|
||||
|
||||
/**
|
||||
* Issue: Add at least one assertion to this test case.
|
||||
* <p>
|
||||
* Solution: Inserted assertion to check whether the execution of the main method in {@link App#main(String[])}
|
||||
* throws an exception.
|
||||
*
|
||||
* <p>Solution: Inserted assertion to check whether the execution of the main method in {@link
|
||||
* App#main(String[])} throws an exception.
|
||||
*/
|
||||
|
||||
@Test
|
||||
void shouldExecuteApplicationWithoutException() {
|
||||
assertDoesNotThrow(() -> App.main(new String[]{}));
|
||||
assertDoesNotThrow(() -> App.main(new String[] {}));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-3
@@ -29,9 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import com.iluwatar.eda.model.User;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* {@link UserCreatedEventTest} tests and verifies {@link AbstractEvent} behaviour.
|
||||
*/
|
||||
/** {@link UserCreatedEventTest} tests and verifies {@link AbstractEvent} behaviour. */
|
||||
class UserCreatedEventTest {
|
||||
|
||||
/**
|
||||
|
||||
+3
-6
@@ -34,9 +34,7 @@ import com.iluwatar.eda.handler.UserUpdatedEventHandler;
|
||||
import com.iluwatar.eda.model.User;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Event Dispatcher unit tests to assert and verify correct event dispatcher behaviour
|
||||
*/
|
||||
/** Event Dispatcher unit tests to assert and verify correct event dispatcher behaviour */
|
||||
class EventDispatcherTest {
|
||||
|
||||
/**
|
||||
@@ -57,15 +55,14 @@ class EventDispatcherTest {
|
||||
var userCreatedEvent = new UserCreatedEvent(user);
|
||||
var userUpdatedEvent = new UserUpdatedEvent(user);
|
||||
|
||||
//fire a userCreatedEvent and verify that userCreatedEventHandler has been invoked.
|
||||
// fire a userCreatedEvent and verify that userCreatedEventHandler has been invoked.
|
||||
dispatcher.dispatch(userCreatedEvent);
|
||||
verify(userCreatedEventHandler).onEvent(userCreatedEvent);
|
||||
verify(dispatcher).dispatch(userCreatedEvent);
|
||||
|
||||
//fire a userCreatedEvent and verify that userUpdatedEventHandler has been invoked.
|
||||
// fire a userCreatedEvent and verify that userUpdatedEventHandler has been invoked.
|
||||
dispatcher.dispatch(userUpdatedEvent);
|
||||
verify(userUpdatedEventHandler).onEvent(userUpdatedEvent);
|
||||
verify(dispatcher).dispatch(userUpdatedEvent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user