From fd63a915f3e51772935b1beb71f8ce3c2909420e Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 25 Dec 2022 15:08:05 +0200 Subject: [PATCH 1/2] BAEL-71323 re-org modules --- javaxval2/.gitignore | 6 --- javaxval2/README.md | 5 -- javaxval2/pom.xml | 34 ------------- ...eanDeserializerModifierWithValidation.java | 20 -------- .../BeanDeserializerWithValidation.java | 40 --------------- .../afterdeserialization/Student.java | 14 ----- .../StudentDeserializerWithValidation.java | 24 --------- ...entDeserializerWithValidationUnitTest.java | 51 ------------------- .../nameTooLongStudent.json | 3 -- .../nameTooShortStudent.json | 3 -- .../afterdeserialization/validStudent.json | 3 -- patterns-modules/README.md | 1 - patterns-modules/coupling/README.md | 2 + .../{wire-tap => }/README.md | 0 patterns-modules/enterprise-patterns/pom.xml | 4 -- .../{wire-tap => }/src/data/.camel/msg1.xml | 0 .../{wire-tap => }/src/data/msg.xml | 0 .../java/com/baeldung/AmqApplication.java | 0 .../src/main/java/com/baeldung/MyBean.java | 0 .../src/main/java/com/baeldung/MyPayload.java | 0 .../com/baeldung/MyPayloadClonePrepare.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/log4j.properties | 0 ...HYLTPDL1209-34209-1621429668568-4-10-1-1-1 | 0 ...HYLTPDL1209-34209-1621429668568-4-11-1-1-1 | 0 ...NHYLTPDL1209-34209-1621429668568-4-2-1-1-1 | 0 ...NHYLTPDL1209-34209-1621429668568-4-3-1-1-1 | 0 ...NHYLTPDL1209-34209-1621429668568-4-4-1-1-1 | 0 ...NHYLTPDL1209-34209-1621429668568-4-5-1-1-1 | 0 ...NHYLTPDL1209-34209-1621429668568-4-6-1-1-1 | 0 ...NHYLTPDL1209-34209-1621429668568-4-7-1-1-1 | 0 ...NHYLTPDL1209-34209-1621429668568-4-8-1-1-1 | 0 ...NHYLTPDL1209-34209-1621429668568-4-9-1-1-1 | 0 ...HYLTPDL1209-46717-1621429562728-4-10-1-1-1 | 0 ...HYLTPDL1209-46717-1621429562728-4-11-1-1-1 | 0 ...NHYLTPDL1209-46717-1621429562728-4-2-1-1-1 | 0 ...NHYLTPDL1209-46717-1621429562728-4-3-1-1-1 | 0 ...NHYLTPDL1209-46717-1621429562728-4-4-1-1-1 | 0 ...NHYLTPDL1209-46717-1621429562728-4-5-1-1-1 | 0 ...NHYLTPDL1209-46717-1621429562728-4-6-1-1-1 | 0 ...NHYLTPDL1209-46717-1621429562728-4-7-1-1-1 | 0 ...NHYLTPDL1209-46717-1621429562728-4-8-1-1-1 | 0 ...NHYLTPDL1209-46717-1621429562728-4-9-1-1-1 | 0 .../enterprise-patterns/wire-tap/pom.xml | 25 --------- .../hexagonal-architecture/pom.xml | 50 ------------------ .../hexagonal/HexArchApplicationDemo.java | 13 ----- .../pattern/hexagonal/config/AppConfig.java | 15 ------ .../pattern/hexagonal/config/MongoConfig.java | 10 ---- .../controller/EmployeeController.java | 25 --------- .../hexagonal/domain/model/Employee.java | 51 ------------------- .../domain/services/EmployeeService.java | 10 ---- .../domain/services/EmployeeServiceImpl.java | 34 ------------- .../persistence/EmployeeRepository.java | 15 ------ .../persistence/MongoDBRepository.java | 24 --------- .../hexagonal/persistence/MongoRepoEx.java | 9 ---- .../src/main/resources/application.properties | 1 - .../services/EmployeeServiceImplUnitTest.java | 46 ----------------- patterns-modules/pom.xml | 1 - 58 files changed, 2 insertions(+), 537 deletions(-) delete mode 100644 javaxval2/.gitignore delete mode 100644 javaxval2/README.md delete mode 100644 javaxval2/pom.xml delete mode 100644 javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/BeanDeserializerModifierWithValidation.java delete mode 100644 javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/BeanDeserializerWithValidation.java delete mode 100644 javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/Student.java delete mode 100644 javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/StudentDeserializerWithValidation.java delete mode 100644 javaxval2/src/test/java/com/baeldung/javaxval/StudentDeserializerWithValidationUnitTest.java delete mode 100644 javaxval2/src/test/resources/afterdeserialization/nameTooLongStudent.json delete mode 100644 javaxval2/src/test/resources/afterdeserialization/nameTooShortStudent.json delete mode 100644 javaxval2/src/test/resources/afterdeserialization/validStudent.json create mode 100644 patterns-modules/coupling/README.md rename patterns-modules/enterprise-patterns/{wire-tap => }/README.md (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/src/data/.camel/msg1.xml (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/src/data/msg.xml (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/src/main/java/com/baeldung/AmqApplication.java (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/src/main/java/com/baeldung/MyBean.java (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/src/main/java/com/baeldung/MyPayload.java (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/src/main/java/com/baeldung/MyPayloadClonePrepare.java (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/src/main/resources/application.properties (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/src/main/resources/log4j.properties (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-10-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-11-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-2-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-3-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-4-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-5-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-6-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-7-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-8-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-9-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-10-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-11-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-2-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-3-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-4-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-5-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-6-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-7-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-8-1-1-1 (100%) rename patterns-modules/enterprise-patterns/{wire-tap => }/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-9-1-1-1 (100%) delete mode 100644 patterns-modules/enterprise-patterns/wire-tap/pom.xml delete mode 100644 patterns-modules/hexagonal-architecture/pom.xml delete mode 100644 patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/HexArchApplicationDemo.java delete mode 100644 patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/AppConfig.java delete mode 100644 patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/MongoConfig.java delete mode 100644 patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/controller/EmployeeController.java delete mode 100644 patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/model/Employee.java delete mode 100644 patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeService.java delete mode 100644 patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImpl.java delete mode 100644 patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/EmployeeRepository.java delete mode 100644 patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoDBRepository.java delete mode 100644 patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoRepoEx.java delete mode 100644 patterns-modules/hexagonal-architecture/src/main/resources/application.properties delete mode 100644 patterns-modules/hexagonal-architecture/src/test/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImplUnitTest.java diff --git a/javaxval2/.gitignore b/javaxval2/.gitignore deleted file mode 100644 index 8027134ae9..0000000000 --- a/javaxval2/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.classpath -.project -.settings/ -target/ -bin/ - diff --git a/javaxval2/README.md b/javaxval2/README.md deleted file mode 100644 index 8f03107330..0000000000 --- a/javaxval2/README.md +++ /dev/null @@ -1,5 +0,0 @@ -## Java Bean Validation Examples - -This module contains articles about Bean Validation. - -### Relevant Articles: diff --git a/javaxval2/pom.xml b/javaxval2/pom.xml deleted file mode 100644 index 2e0ed0a281..0000000000 --- a/javaxval2/pom.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - 4.0.0 - javaxval2 - 0.1-SNAPSHOT - javaxval2 - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - org.springframework.boot - spring-boot-starter-validation - ${spring.boot.version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.databind.version} - - - - - 2.7.5 - 2.14.0 - - - \ No newline at end of file diff --git a/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/BeanDeserializerModifierWithValidation.java b/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/BeanDeserializerModifierWithValidation.java deleted file mode 100644 index 3e20ebad6b..0000000000 --- a/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/BeanDeserializerModifierWithValidation.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.baeldung.javaxval.afterdeserialization; - -import com.fasterxml.jackson.databind.BeanDescription; -import com.fasterxml.jackson.databind.DeserializationConfig; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.deser.BeanDeserializer; -import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier; - -public class BeanDeserializerModifierWithValidation extends BeanDeserializerModifier { - - @Override - public JsonDeserializer modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer deserializer) { - if (deserializer instanceof BeanDeserializer) { - return new BeanDeserializerWithValidation((BeanDeserializer) deserializer); - } - - return deserializer; - } - -} diff --git a/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/BeanDeserializerWithValidation.java b/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/BeanDeserializerWithValidation.java deleted file mode 100644 index 332c83010d..0000000000 --- a/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/BeanDeserializerWithValidation.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.baeldung.javaxval.afterdeserialization; - -import java.io.IOException; -import java.util.Set; - -import javax.validation.ConstraintViolation; -import javax.validation.ConstraintViolationException; -import javax.validation.Validation; -import javax.validation.Validator; -import javax.validation.ValidatorFactory; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.deser.BeanDeserializer; -import com.fasterxml.jackson.databind.deser.BeanDeserializerBase; - -public class BeanDeserializerWithValidation extends BeanDeserializer { - - private static final ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); - private static final Validator validator = factory.getValidator(); - - protected BeanDeserializerWithValidation(BeanDeserializerBase src) { - super(src); - } - - @Override - public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object instance = super.deserialize(p, ctxt); - validate(instance); - return instance; - } - - public void validate(T t) { - Set> violations = validator.validate(t); - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } - -} diff --git a/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/Student.java b/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/Student.java deleted file mode 100644 index c1923de265..0000000000 --- a/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/Student.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.javaxval.afterdeserialization; - -import javax.validation.constraints.Size; - -public class Student { - - @Size(min = 5, max = 10, message = "Student's name must be between 5 and 10 characters") - private String name; - - public String getName() { - return name; - } - -} diff --git a/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/StudentDeserializerWithValidation.java b/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/StudentDeserializerWithValidation.java deleted file mode 100644 index e652a43ccb..0000000000 --- a/javaxval2/src/main/java/com/baeldung/javaxval/afterdeserialization/StudentDeserializerWithValidation.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.javaxval.afterdeserialization; - -import java.io.IOException; -import java.io.InputStream; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.module.SimpleModule; - -public class StudentDeserializerWithValidation { - - public static Student readStudent(InputStream inputStream) throws IOException { - ObjectMapper mapper = getObjectMapperWithValidation(); - return mapper.readValue(inputStream, Student.class); - } - - private static ObjectMapper getObjectMapperWithValidation() { - SimpleModule validationModule = new SimpleModule(); - validationModule.setDeserializerModifier(new BeanDeserializerModifierWithValidation()); - ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule(validationModule); - return mapper; - } - -} diff --git a/javaxval2/src/test/java/com/baeldung/javaxval/StudentDeserializerWithValidationUnitTest.java b/javaxval2/src/test/java/com/baeldung/javaxval/StudentDeserializerWithValidationUnitTest.java deleted file mode 100644 index edbe85ecfe..0000000000 --- a/javaxval2/src/test/java/com/baeldung/javaxval/StudentDeserializerWithValidationUnitTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.baeldung.javaxval; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; - -import java.io.IOException; -import java.io.InputStream; - -import javax.validation.ConstraintViolationException; - -import org.junit.jupiter.api.Test; - -import com.baeldung.javaxval.afterdeserialization.Student; -import com.baeldung.javaxval.afterdeserialization.StudentDeserializerWithValidation; - -public class StudentDeserializerWithValidationUnitTest { - - private final String EXPECTED_ERROR_MESSAGE = "name: Student's name must be between 5 and 10 characters"; - private final String EXPECTED_STUDENT_NAME = "Daniel"; - private final String NAME_TOO_LONG_STUDENT_FILE = "nameTooLongStudent.json"; - private final String NAME_TOO_SHORT_STUDENT_FILE = "nameTooShortStudent.json"; - private final String SUBDIRECTORY = "afterdeserialization/"; - private final String VALID_STUDENT_FILE = "validStudent.json"; - - @Test - void givenValidStudent_WhenReadStudent_ThenReturnStudent() throws IOException { - InputStream inputStream = getInputStream(VALID_STUDENT_FILE); - Student result = StudentDeserializerWithValidation.readStudent(inputStream); - assertEquals(EXPECTED_STUDENT_NAME, result.getName()); - } - - @Test - void givenStudentWithTooShortName_WhenReadStudent_ThenThrows() { - InputStream inputStream = getInputStream(NAME_TOO_SHORT_STUDENT_FILE); - ConstraintViolationException constraintViolationException = assertThrows(ConstraintViolationException.class, () -> StudentDeserializerWithValidation.readStudent(inputStream)); - assertEquals(EXPECTED_ERROR_MESSAGE, constraintViolationException.getMessage()); - } - - @Test - void givenStudentWithTooLongName_WhenReadStudent_ThenThrows() { - InputStream inputStream = getInputStream(NAME_TOO_LONG_STUDENT_FILE); - ConstraintViolationException constraintViolationException = assertThrows(ConstraintViolationException.class, () -> StudentDeserializerWithValidation.readStudent(inputStream)); - assertEquals(EXPECTED_ERROR_MESSAGE, constraintViolationException.getMessage()); - } - - private InputStream getInputStream(String fileName) { - return getClass().getClassLoader() - .getResourceAsStream(SUBDIRECTORY + fileName); - } - -} diff --git a/javaxval2/src/test/resources/afterdeserialization/nameTooLongStudent.json b/javaxval2/src/test/resources/afterdeserialization/nameTooLongStudent.json deleted file mode 100644 index e537ecb25d..0000000000 --- a/javaxval2/src/test/resources/afterdeserialization/nameTooLongStudent.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "Constantine" -} \ No newline at end of file diff --git a/javaxval2/src/test/resources/afterdeserialization/nameTooShortStudent.json b/javaxval2/src/test/resources/afterdeserialization/nameTooShortStudent.json deleted file mode 100644 index 79ab10cb80..0000000000 --- a/javaxval2/src/test/resources/afterdeserialization/nameTooShortStudent.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "Max" -} \ No newline at end of file diff --git a/javaxval2/src/test/resources/afterdeserialization/validStudent.json b/javaxval2/src/test/resources/afterdeserialization/validStudent.json deleted file mode 100644 index 938002ea51..0000000000 --- a/javaxval2/src/test/resources/afterdeserialization/validStudent.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "Daniel" -} \ No newline at end of file diff --git a/patterns-modules/README.md b/patterns-modules/README.md index 8cf237defd..654beb4cd7 100644 --- a/patterns-modules/README.md +++ b/patterns-modules/README.md @@ -2,4 +2,3 @@ This module contains articles about design patterns. -- [Coupling in Java](https://www.baeldung.com/java-coupling-classes-tight-loose) diff --git a/patterns-modules/coupling/README.md b/patterns-modules/coupling/README.md new file mode 100644 index 0000000000..2d39e74474 --- /dev/null +++ b/patterns-modules/coupling/README.md @@ -0,0 +1,2 @@ + +- [Coupling in Java](https://www.baeldung.com/java-coupling-classes-tight-loose) diff --git a/patterns-modules/enterprise-patterns/wire-tap/README.md b/patterns-modules/enterprise-patterns/README.md similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/README.md rename to patterns-modules/enterprise-patterns/README.md diff --git a/patterns-modules/enterprise-patterns/pom.xml b/patterns-modules/enterprise-patterns/pom.xml index aee56c04ff..2c59ae2536 100644 --- a/patterns-modules/enterprise-patterns/pom.xml +++ b/patterns-modules/enterprise-patterns/pom.xml @@ -12,10 +12,6 @@ 1.0.0-SNAPSHOT - - wire-tap - - diff --git a/patterns-modules/enterprise-patterns/wire-tap/src/data/.camel/msg1.xml b/patterns-modules/enterprise-patterns/src/data/.camel/msg1.xml similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/src/data/.camel/msg1.xml rename to patterns-modules/enterprise-patterns/src/data/.camel/msg1.xml diff --git a/patterns-modules/enterprise-patterns/wire-tap/src/data/msg.xml b/patterns-modules/enterprise-patterns/src/data/msg.xml similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/src/data/msg.xml rename to patterns-modules/enterprise-patterns/src/data/msg.xml diff --git a/patterns-modules/enterprise-patterns/wire-tap/src/main/java/com/baeldung/AmqApplication.java b/patterns-modules/enterprise-patterns/src/main/java/com/baeldung/AmqApplication.java similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/src/main/java/com/baeldung/AmqApplication.java rename to patterns-modules/enterprise-patterns/src/main/java/com/baeldung/AmqApplication.java diff --git a/patterns-modules/enterprise-patterns/wire-tap/src/main/java/com/baeldung/MyBean.java b/patterns-modules/enterprise-patterns/src/main/java/com/baeldung/MyBean.java similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/src/main/java/com/baeldung/MyBean.java rename to patterns-modules/enterprise-patterns/src/main/java/com/baeldung/MyBean.java diff --git a/patterns-modules/enterprise-patterns/wire-tap/src/main/java/com/baeldung/MyPayload.java b/patterns-modules/enterprise-patterns/src/main/java/com/baeldung/MyPayload.java similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/src/main/java/com/baeldung/MyPayload.java rename to patterns-modules/enterprise-patterns/src/main/java/com/baeldung/MyPayload.java diff --git a/patterns-modules/enterprise-patterns/wire-tap/src/main/java/com/baeldung/MyPayloadClonePrepare.java b/patterns-modules/enterprise-patterns/src/main/java/com/baeldung/MyPayloadClonePrepare.java similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/src/main/java/com/baeldung/MyPayloadClonePrepare.java rename to patterns-modules/enterprise-patterns/src/main/java/com/baeldung/MyPayloadClonePrepare.java diff --git a/patterns-modules/enterprise-patterns/wire-tap/src/main/resources/application.properties b/patterns-modules/enterprise-patterns/src/main/resources/application.properties similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/src/main/resources/application.properties rename to patterns-modules/enterprise-patterns/src/main/resources/application.properties diff --git a/patterns-modules/enterprise-patterns/wire-tap/src/main/resources/log4j.properties b/patterns-modules/enterprise-patterns/src/main/resources/log4j.properties similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/src/main/resources/log4j.properties rename to patterns-modules/enterprise-patterns/src/main/resources/log4j.properties diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-10-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-10-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-10-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-10-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-11-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-11-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-11-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-11-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-2-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-2-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-2-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-2-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-3-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-3-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-3-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-3-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-4-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-4-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-4-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-4-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-5-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-5-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-5-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-5-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-6-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-6-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-6-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-6-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-7-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-7-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-7-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-7-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-8-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-8-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-8-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-8-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-9-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-9-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-9-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-34209-1621429668568-4-9-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-10-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-10-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-10-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-10-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-11-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-11-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-11-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-11-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-2-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-2-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-2-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-2-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-3-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-3-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-3-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-3-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-4-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-4-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-4-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-4-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-5-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-5-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-5-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-5-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-6-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-6-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-6-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-6-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-7-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-7-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-7-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-7-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-8-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-8-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-8-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-8-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-9-1-1-1 b/patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-9-1-1-1 similarity index 100% rename from patterns-modules/enterprise-patterns/wire-tap/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-9-1-1-1 rename to patterns-modules/enterprise-patterns/test/ID-PRINHYLTPDL1209-46717-1621429562728-4-9-1-1-1 diff --git a/patterns-modules/enterprise-patterns/wire-tap/pom.xml b/patterns-modules/enterprise-patterns/wire-tap/pom.xml deleted file mode 100644 index e7959e17f0..0000000000 --- a/patterns-modules/enterprise-patterns/wire-tap/pom.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - 4.0.0 - wire-tap - 1.0 - jar - - - enterprise-patterns - com.baeldung - 1.0.0-SNAPSHOT - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - \ No newline at end of file diff --git a/patterns-modules/hexagonal-architecture/pom.xml b/patterns-modules/hexagonal-architecture/pom.xml deleted file mode 100644 index b18bd49aec..0000000000 --- a/patterns-modules/hexagonal-architecture/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - 4.0.0 - com.baeldung - hexagonal-architecture - 1.0 - hexagonal-architecture - Project for hexagonal architecture in java - - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-data-mongodb - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - \ No newline at end of file diff --git a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/HexArchApplicationDemo.java b/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/HexArchApplicationDemo.java deleted file mode 100644 index 52aaefaaf7..0000000000 --- a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/HexArchApplicationDemo.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.pattern.hexagonal; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class HexArchApplicationDemo { - - public static void main(String[] args) { - SpringApplication.run(HexArchApplicationDemo.class, args); - } - -} diff --git a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/AppConfig.java b/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/AppConfig.java deleted file mode 100644 index ee8a01d0e2..0000000000 --- a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/AppConfig.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.pattern.hexagonal.config; - -import com.baeldung.pattern.hexagonal.domain.services.EmployeeService; -import com.baeldung.pattern.hexagonal.domain.services.EmployeeServiceImpl; -import com.baeldung.pattern.hexagonal.persistence.EmployeeRepository; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class AppConfig { - @Bean - public EmployeeService getEmployeeService(EmployeeRepository employeeRepository) { - return new EmployeeServiceImpl(employeeRepository); - } -} diff --git a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/MongoConfig.java b/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/MongoConfig.java deleted file mode 100644 index fa6980824a..0000000000 --- a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/config/MongoConfig.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.baeldung.pattern.hexagonal.config; - -import com.baeldung.pattern.hexagonal.persistence.MongoRepoEx; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; - -@Configuration -@EnableMongoRepositories(basePackageClasses = MongoRepoEx.class) -public class MongoConfig { -} diff --git a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/controller/EmployeeController.java b/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/controller/EmployeeController.java deleted file mode 100644 index 077fc6fdea..0000000000 --- a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/controller/EmployeeController.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.pattern.hexagonal.controller; - -import com.baeldung.pattern.hexagonal.domain.model.Employee; -import com.baeldung.pattern.hexagonal.domain.services.EmployeeService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/employees") -public class EmployeeController { - @Autowired - EmployeeService employeeService; - - @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public Employee addEmployee(@RequestBody Employee employee) { - return employeeService.addEmployee(employee); - } - - @GetMapping(path = "/{employeeId}") - public Employee getEmployee(@PathVariable("employeeId") String employeeId) { - return employeeService.getEmployee(employeeId); - } -} diff --git a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/model/Employee.java b/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/model/Employee.java deleted file mode 100644 index de1f15cf53..0000000000 --- a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/model/Employee.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.baeldung.pattern.hexagonal.domain.model; - -import org.springframework.data.annotation.Id; - -import java.util.Objects; - -public class Employee { - @Id - private String empId; - private String empName; - private String empJobTitle; - - public String getEmpId() { - return empId; - } - - public void setEmpId(String empId) { - this.empId = empId; - } - - public String getEmpName() { - return empName; - } - - public void setEmpName(String empName) { - this.empName = empName; - } - - public String getEmpJobTitle() { - return empJobTitle; - } - - public void setEmpJobTitle(String empJobTitle) { - this.empJobTitle = empJobTitle; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - Employee employee = (Employee) o; - return empId.equals(employee.empId); - } - - @Override - public int hashCode() { - return Objects.hash(empId); - } -} \ No newline at end of file diff --git a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeService.java b/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeService.java deleted file mode 100644 index 902abefabb..0000000000 --- a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.baeldung.pattern.hexagonal.domain.services; - -import com.baeldung.pattern.hexagonal.domain.model.Employee; - -public interface EmployeeService { - - Employee addEmployee(Employee employee); - - Employee getEmployee(String employeeId); -} diff --git a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImpl.java b/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImpl.java deleted file mode 100644 index cd7c30ff30..0000000000 --- a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.baeldung.pattern.hexagonal.domain.services; - -import com.baeldung.pattern.hexagonal.domain.model.Employee; -import com.baeldung.pattern.hexagonal.persistence.EmployeeRepository; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Optional; - -public class EmployeeServiceImpl implements EmployeeService { - - private EmployeeRepository employeeRepository; - - @Autowired - public EmployeeServiceImpl(EmployeeRepository employeeRepository) { - this.employeeRepository = employeeRepository; - } - - @Override - public Employee addEmployee(Employee employee) { - return employeeRepository.add(employee); - } - - @Override - public Employee getEmployee(String employeeId) { - Optional employee = employeeRepository.findById(employeeId); - - if (employee.isPresent()) { - return employee.get(); - } else { - // throw - } - return null; - } -} diff --git a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/EmployeeRepository.java b/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/EmployeeRepository.java deleted file mode 100644 index 53b4b6d276..0000000000 --- a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/EmployeeRepository.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.pattern.hexagonal.persistence; - -import com.baeldung.pattern.hexagonal.domain.model.Employee; -import org.springframework.stereotype.Repository; - -import java.util.Optional; - -@Repository -public interface EmployeeRepository { - - Employee add(Employee employee); - - Optional findById(String id); - -} diff --git a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoDBRepository.java b/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoDBRepository.java deleted file mode 100644 index 08f0c96ab0..0000000000 --- a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoDBRepository.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.pattern.hexagonal.persistence; - -import com.baeldung.pattern.hexagonal.domain.model.Employee; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - -import java.util.Optional; - -@Repository -public class MongoDBRepository implements EmployeeRepository { - - @Autowired - MongoRepoEx mongoRepository; - - @Override - public Employee add(Employee employee) { - return mongoRepository.insert(employee); - } - - @Override - public Optional findById(String id) { - return mongoRepository.findById(id); - } -} diff --git a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoRepoEx.java b/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoRepoEx.java deleted file mode 100644 index 766444c22f..0000000000 --- a/patterns-modules/hexagonal-architecture/src/main/java/com/baeldung/pattern/hexagonal/persistence/MongoRepoEx.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.baeldung.pattern.hexagonal.persistence; - -import com.baeldung.pattern.hexagonal.domain.model.Employee; -import org.springframework.data.mongodb.repository.MongoRepository; -import org.springframework.stereotype.Repository; - -@Repository -public interface MongoRepoEx extends MongoRepository { -} diff --git a/patterns-modules/hexagonal-architecture/src/main/resources/application.properties b/patterns-modules/hexagonal-architecture/src/main/resources/application.properties deleted file mode 100644 index 8b13789179..0000000000 --- a/patterns-modules/hexagonal-architecture/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/patterns-modules/hexagonal-architecture/src/test/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImplUnitTest.java b/patterns-modules/hexagonal-architecture/src/test/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImplUnitTest.java deleted file mode 100644 index 542e45d6f4..0000000000 --- a/patterns-modules/hexagonal-architecture/src/test/java/com/baeldung/pattern/hexagonal/domain/services/EmployeeServiceImplUnitTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.baeldung.pattern.hexagonal.domain.services; - -import com.baeldung.pattern.hexagonal.domain.model.Employee; -import com.baeldung.pattern.hexagonal.persistence.EmployeeRepository; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -class EmployeeServiceImplUnitTest { - - private EmployeeRepository employeeRepository; - private EmployeeService testService; - private Employee testModel; - - @BeforeEach - void setUp() { - employeeRepository = mock(EmployeeRepository.class); - - testService = new EmployeeServiceImpl(employeeRepository); - testModel = new Employee(); - testModel.setEmpId("2000"); - testModel.setEmpName("Test user 1"); - testModel.setEmpJobTitle("Software engineer"); - } - - @Test - void addEmployee() { - when(employeeRepository.add(any(Employee.class))).thenReturn(testModel); - - Employee testResponse = testService.addEmployee(testModel); - assertEquals(testModel, testResponse); - } - - @Test - void getEmployee() { - when(employeeRepository.findById("2000")).thenReturn(Optional.of(testModel)); - - Employee testResponse = testService.getEmployee("2000"); - assertEquals(testModel, testResponse); - } -} \ No newline at end of file diff --git a/patterns-modules/pom.xml b/patterns-modules/pom.xml index 0bd2b0453b..26d9a76aee 100644 --- a/patterns-modules/pom.xml +++ b/patterns-modules/pom.xml @@ -26,7 +26,6 @@ dip cqrs-es front-controller - hexagonal-architecture intercepting-filter solid clean-architecture From e99b6866f52ff5020bbb38fb9c2733871570fe85 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 25 Dec 2022 15:13:43 +0200 Subject: [PATCH 2/2] BAEL-71323 remove old module from pom --- pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index b57d3bf3fb..a5bdd2cf4c 100644 --- a/pom.xml +++ b/pom.xml @@ -411,7 +411,6 @@ javax-sound javaxval javaxval-2 - javaxval2 javax-validation-advanced jaxb jersey @@ -797,7 +796,6 @@ javax-sound javaxval javaxval-2 - javaxval2 javax-validation-advanced jaxb jersey