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:
Ilkka Seppälä
2025-03-29 19:34:27 +02:00
committed by GitHub
parent 371439aeaa
commit 0ca162a55c
1863 changed files with 14408 additions and 17637 deletions
@@ -33,42 +33,41 @@ import org.junit.jupiter.api.Test;
class RegisterWorkerFormTest {
private RegisterWorkerForm registerWorkerForm;
private RegisterWorkerForm registerWorkerForm;
@Test
void submitSuccessfully() {
// Ensure the worker is null initially
registerWorkerForm = new RegisterWorkerForm("John Doe", "Engineer", LocalDate.of(1990, 1, 1));
@Test
void submitSuccessfully() {
// Ensure the worker is null initially
registerWorkerForm = new RegisterWorkerForm("John Doe", "Engineer", LocalDate.of(1990, 1, 1));
assertNull(registerWorkerForm.worker);
assertNull(registerWorkerForm.worker);
// Submit the form
registerWorkerForm.submit();
// Submit the form
registerWorkerForm.submit();
// Verify that the worker is not null after submission
assertNotNull(registerWorkerForm.worker);
// Verify that the worker is not null after submission
assertNotNull(registerWorkerForm.worker);
// Verify that the worker's properties are set correctly
assertEquals("John Doe", registerWorkerForm.worker.getName());
assertEquals("Engineer", registerWorkerForm.worker.getOccupation());
assertEquals(LocalDate.of(1990, 1, 1), registerWorkerForm.worker.getDateOfBirth());
}
// Verify that the worker's properties are set correctly
assertEquals("John Doe", registerWorkerForm.worker.getName());
assertEquals("Engineer", registerWorkerForm.worker.getOccupation());
assertEquals(LocalDate.of(1990, 1, 1), registerWorkerForm.worker.getDateOfBirth());
}
@Test
void submitWithErrors() {
// Set up the worker with a notification containing errors
registerWorkerForm = new RegisterWorkerForm(null, null, null);
@Test
void submitWithErrors() {
// Set up the worker with a notification containing errors
registerWorkerForm = new RegisterWorkerForm(null, null, null);
// Submit the form
registerWorkerForm.submit();
// Submit the form
registerWorkerForm.submit();
// Verify that the worker's properties remain unchanged
assertNull(registerWorkerForm.worker.getName());
assertNull(registerWorkerForm.worker.getOccupation());
assertNull(registerWorkerForm.worker.getDateOfBirth());
// Verify the presence of errors
assertEquals(registerWorkerForm.worker.getNotification().getErrors().size(), 4);
}
// Verify that the worker's properties remain unchanged
assertNull(registerWorkerForm.worker.getName());
assertNull(registerWorkerForm.worker.getOccupation());
assertNull(registerWorkerForm.worker.getDateOfBirth());
// Verify the presence of errors
assertEquals(registerWorkerForm.worker.getNotification().getErrors().size(), 4);
}
}