From 1e459d7fa3a3d8adc313eeb0ef99ac4e7fb8e9a9 Mon Sep 17 00:00:00 2001 From: Pavel Vetokhin Date: Sat, 7 Oct 2023 11:34:43 +0300 Subject: [PATCH 1/5] Introduce slice mapper --- apps/pom.xml | 8 +++---- .../smecalculus/bezmen/construction/App.java | 14 ++++++------- .../bezmen/core/SepulkaConverterImpl.java | 9 -------- .../bezmen/core/SepulkaServiceImpl.java | 6 +++--- .../bezmen/messaging/SepulkaClientImpl.java | 14 ++++++------- .../bezmen/messaging/SepulkaMsgMapper.java | 12 +++++------ ...qMsg.java => SepulkaRegisterSliceMsg.java} | 2 +- ...sg.java => SepulkaRegisteredSliceMsg.java} | 3 +-- .../springmvc/SepulkaController.java | 19 ++++++++--------- .../construction/SepulkaClientBeans.java | 12 +++++------ .../bezmen/messaging/SepulkaClientIT.java | 16 +++++++------- .../messaging/SepulkaClientSpringWeb.java | 12 +++++------ .../bezmen/core/SepulkaConverter.java | 7 ------- .../bezmen/core/SepulkaService.java | 4 ++-- .../bezmen/core/SepulkaSliceMapper.java | 9 ++++++++ .../messaging/client/SepulkaClient.java | 2 +- .../messaging/client/SepulkaRegReqEg.java | 11 ---------- .../messaging/client/SepulkaRegResEg.java | 21 ------------------- ...aRegReq.java => SepulkaRegisterSlice.java} | 2 +- .../client/SepulkaRegisterSliceEg.java | 11 ++++++++++ ...egRes.java => SepulkaRegisteredSlice.java} | 2 +- .../client/SepulkaRegisteredSliceEg.java | 16 ++++++++++++++ .../client/BezmenClientJavaHttp.java | 6 +++--- .../bezmen/registration/SepulkaTest.java | 14 ++++++------- 24 files changed, 109 insertions(+), 123 deletions(-) delete mode 100644 apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaConverterImpl.java rename apps/sepuling/src/main/java/smecalculus/bezmen/messaging/{SepulkaRegReqMsg.java => SepulkaRegisterSliceMsg.java} (70%) rename apps/sepuling/src/main/java/smecalculus/bezmen/messaging/{SepulkaRegResMsg.java => SepulkaRegisteredSliceMsg.java} (61%) delete mode 100644 libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaConverter.java create mode 100644 libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaSliceMapper.java delete mode 100644 libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegReqEg.java delete mode 100644 libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegResEg.java rename libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/{SepulkaRegReq.java => SepulkaRegisterSlice.java} (53%) create mode 100644 libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSliceEg.java rename libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/{SepulkaRegRes.java => SepulkaRegisteredSlice.java} (56%) create mode 100644 libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSliceEg.java diff --git a/apps/pom.xml b/apps/pom.xml index b04e85aa..2d0e0166 100644 --- a/apps/pom.xml +++ b/apps/pom.xml @@ -58,14 +58,14 @@ org.apache.maven.plugins maven-surefire-plugin - - org.jacoco - jacoco-maven-plugin - org.apache.maven.plugins maven-failsafe-plugin + + org.jacoco + jacoco-maven-plugin + diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java b/apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java index c54d424c..7af778c4 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java @@ -9,10 +9,10 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.PropertySource; -import smecalculus.bezmen.core.SepulkaConverter; -import smecalculus.bezmen.core.SepulkaConverterImpl; import smecalculus.bezmen.core.SepulkaService; import smecalculus.bezmen.core.SepulkaServiceImpl; +import smecalculus.bezmen.core.SepulkaSliceMapper; +import smecalculus.bezmen.core.SepulkaSliceMapperImpl; import smecalculus.bezmen.messaging.SepulkaClientImpl; import smecalculus.bezmen.messaging.SepulkaMsgMapper; import smecalculus.bezmen.messaging.SepulkaMsgMapperImpl; @@ -27,7 +27,7 @@ import smecalculus.bezmen.storage.springdata.SepulkaRepository; import smecalculus.bezmen.validation.EdgeValidator; -@Import({ConfigBeans.class, ValidationBeans.class, MessagingBeans.class, StorageBeans.class}) +@Import({ValidationBeans.class, ConfigBeans.class, MessagingBeans.class, StorageBeans.class}) @PropertySource("classpath:application.properties") @Configuration(proxyBeanMethods = false) public class App { @@ -49,8 +49,8 @@ SepulkaMsgMapper sepulkaMsgMapper() { } @Bean - SepulkaClient sepulkaClient(SepulkaService service, SepulkaConverter converter) { - return new SepulkaClientImpl(service, converter); + SepulkaClient sepulkaClient(SepulkaService service, SepulkaSliceMapper mapper) { + return new SepulkaClientImpl(service, mapper); } @Bean @@ -59,8 +59,8 @@ SepulkaService sepulkaService(SepulkaDao sepulkaDao) { } @Bean - SepulkaConverter sepulkaConverter() { - return new SepulkaConverterImpl(); + SepulkaSliceMapper sepulkaSliceMapper() { + return new SepulkaSliceMapperImpl(); } @Bean diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaConverterImpl.java b/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaConverterImpl.java deleted file mode 100644 index e54756a9..00000000 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaConverterImpl.java +++ /dev/null @@ -1,9 +0,0 @@ -package smecalculus.bezmen.core; - -import smecalculus.bezmen.messaging.client.SepulkaRegRes; - -public class SepulkaConverterImpl implements SepulkaConverter { - public SepulkaRegRes toRegRes(Sepulka sepulka) { - return new SepulkaRegRes(sepulka.id(), sepulka.name()); - } -} diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java b/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java index 896560db..9ca64422 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java @@ -4,15 +4,15 @@ import java.util.List; import lombok.NonNull; -import smecalculus.bezmen.messaging.client.SepulkaRegReq; +import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; import smecalculus.bezmen.storage.SepulkaDao; public record SepulkaServiceImpl(@NonNull SepulkaDao sepulkaDao) implements SepulkaService { @Override - public Sepulka register(SepulkaRegReq sepulkaRegReq) { + public Sepulka register(SepulkaRegisterSlice slice) { Sepulka sepulka = - Sepulka.builder().id(randomUUID()).name(sepulkaRegReq.name()).build(); + Sepulka.builder().id(randomUUID()).name(slice.name()).build(); return sepulkaDao.save(sepulka); } diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java index ff21f451..df2d839a 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java @@ -2,18 +2,18 @@ import lombok.NonNull; import smecalculus.bezmen.core.Sepulka; -import smecalculus.bezmen.core.SepulkaConverter; import smecalculus.bezmen.core.SepulkaService; +import smecalculus.bezmen.core.SepulkaSliceMapper; import smecalculus.bezmen.messaging.client.SepulkaClient; -import smecalculus.bezmen.messaging.client.SepulkaRegReq; -import smecalculus.bezmen.messaging.client.SepulkaRegRes; +import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; +import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; -public record SepulkaClientImpl(@NonNull SepulkaService service, @NonNull SepulkaConverter converter) +public record SepulkaClientImpl(@NonNull SepulkaService service, @NonNull SepulkaSliceMapper mapper) implements SepulkaClient { @Override - public SepulkaRegRes register(SepulkaRegReq request) { - Sepulka sepulka = service.register(request); - return converter.toRegRes(sepulka); + public SepulkaRegisteredSlice register(SepulkaRegisterSlice command) { + Sepulka sepulka = service.register(command); + return mapper.toSlice(sepulka); } } diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaMsgMapper.java b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaMsgMapper.java index 11fb59bd..e8a3f9d5 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaMsgMapper.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaMsgMapper.java @@ -1,16 +1,16 @@ package smecalculus.bezmen.messaging; import org.mapstruct.Mapper; -import smecalculus.bezmen.messaging.client.SepulkaRegReq; -import smecalculus.bezmen.messaging.client.SepulkaRegRes; +import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; +import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; @Mapper public interface SepulkaMsgMapper { - SepulkaRegReqMsg toMsg(SepulkaRegReq sepulkaRegReq); + SepulkaRegisterSliceMsg toMsg(SepulkaRegisterSlice slice); - SepulkaRegReq toDomain(SepulkaRegReqMsg sepulkaRegReqMsg); + SepulkaRegisterSlice toDomain(SepulkaRegisterSliceMsg sliceMsg); - SepulkaRegResMsg toMsg(SepulkaRegRes sepulkaRegRes); + SepulkaRegisteredSliceMsg toMsg(SepulkaRegisteredSlice slice); - SepulkaRegRes toDomain(SepulkaRegResMsg sepulkaRegResMsg); + SepulkaRegisteredSlice toDomain(SepulkaRegisteredSliceMsg sliceMsg); } diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegReqMsg.java b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisterSliceMsg.java similarity index 70% rename from apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegReqMsg.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisterSliceMsg.java index 3b89a838..e8761755 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegReqMsg.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisterSliceMsg.java @@ -3,6 +3,6 @@ import lombok.Data; @Data -public class SepulkaRegReqMsg { +public class SepulkaRegisterSliceMsg { private String name; } diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegResMsg.java b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisteredSliceMsg.java similarity index 61% rename from apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegResMsg.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisteredSliceMsg.java index 7cc8b032..7d38455c 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegResMsg.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisteredSliceMsg.java @@ -3,7 +3,6 @@ import lombok.Data; @Data -public class SepulkaRegResMsg { +public class SepulkaRegisteredSliceMsg { private String id; - private String name; } diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/springmvc/SepulkaController.java b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/springmvc/SepulkaController.java index 361e030b..dd51b8fd 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/springmvc/SepulkaController.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/springmvc/SepulkaController.java @@ -8,11 +8,11 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import smecalculus.bezmen.messaging.SepulkaMsgMapper; -import smecalculus.bezmen.messaging.SepulkaRegReqMsg; -import smecalculus.bezmen.messaging.SepulkaRegResMsg; +import smecalculus.bezmen.messaging.SepulkaRegisterSliceMsg; +import smecalculus.bezmen.messaging.SepulkaRegisteredSliceMsg; import smecalculus.bezmen.messaging.client.SepulkaClient; -import smecalculus.bezmen.messaging.client.SepulkaRegReq; -import smecalculus.bezmen.messaging.client.SepulkaRegRes; +import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; +import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; import smecalculus.bezmen.validation.EdgeValidator; @RestController @@ -21,11 +21,10 @@ public record SepulkaController( @NonNull EdgeValidator validator, @NonNull SepulkaClient client, @NonNull SepulkaMsgMapper mapper) { @PostMapping - ResponseEntity register(@RequestBody SepulkaRegReqMsg sepulkaRegReqMsg) { - // TODO: контроллер отвечает только за сборку msg-модели и валидацию - validator.validate(sepulkaRegReqMsg); - SepulkaRegReq sepulkaRegReq = mapper.toDomain(sepulkaRegReqMsg); - SepulkaRegRes sepulkaRegRes = client.register(sepulkaRegReq); - return ResponseEntity.status(HttpStatus.CREATED).body(mapper.toMsg(sepulkaRegRes)); + ResponseEntity register(@RequestBody SepulkaRegisterSliceMsg sliceMsg) { + validator.validate(sliceMsg); + SepulkaRegisterSlice registerSlice = mapper.toDomain(sliceMsg); + SepulkaRegisteredSlice registeredSlice = client.register(registerSlice); + return ResponseEntity.status(HttpStatus.CREATED).body(mapper.toMsg(registeredSlice)); } } diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaClientBeans.java b/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaClientBeans.java index bb1af9fc..4d829d95 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaClientBeans.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaClientBeans.java @@ -7,9 +7,9 @@ import org.springframework.context.annotation.Import; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.servlet.client.MockMvcWebTestClient; -import smecalculus.bezmen.core.SepulkaConverter; -import smecalculus.bezmen.core.SepulkaConverterImpl; import smecalculus.bezmen.core.SepulkaService; +import smecalculus.bezmen.core.SepulkaSliceMapper; +import smecalculus.bezmen.core.SepulkaSliceMapperImpl; import smecalculus.bezmen.messaging.SepulkaClientImpl; import smecalculus.bezmen.messaging.SepulkaClientSpringWeb; import smecalculus.bezmen.messaging.SepulkaMsgMapper; @@ -28,13 +28,13 @@ public SepulkaService sepulkaService() { } @Bean - SepulkaConverter sepulkaConverter() { - return new SepulkaConverterImpl(); + SepulkaSliceMapper sepulkaConverter() { + return new SepulkaSliceMapperImpl(); } @Bean - SepulkaClient internalClient(SepulkaService service, SepulkaConverterImpl converter) { - return new SepulkaClientImpl(service, converter); + SepulkaClient internalClient(SepulkaService service, SepulkaSliceMapper mapper) { + return new SepulkaClientImpl(service, mapper); } @Bean diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientIT.java b/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientIT.java index d6d71b71..19694404 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientIT.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientIT.java @@ -4,8 +4,8 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; import static smecalculus.bezmen.core.SepulkaEg.Pojos.sepulka; -import static smecalculus.bezmen.messaging.client.SepulkaRegReqEg.Pojos.sepulkaRegReq; -import static smecalculus.bezmen.messaging.client.SepulkaRegResEg.Pojos.sepulkaRegRes; +import static smecalculus.bezmen.messaging.client.SepulkaRegisterSliceEg.Pojos.sepulkaRegisterSlice; +import static smecalculus.bezmen.messaging.client.SepulkaRegisteredSliceEg.Pojos.sepulkaRegisteredSlice; import java.util.UUID; import org.junit.jupiter.api.Test; @@ -16,8 +16,8 @@ import smecalculus.bezmen.construction.SepulkaClientBeans; import smecalculus.bezmen.core.SepulkaService; import smecalculus.bezmen.messaging.client.SepulkaClient; -import smecalculus.bezmen.messaging.client.SepulkaRegReq; -import smecalculus.bezmen.messaging.client.SepulkaRegRes; +import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; +import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; @ExtendWith(SpringExtension.class) @ContextConfiguration(classes = SepulkaClientBeans.class) @@ -34,13 +34,13 @@ void shouldRegisterSepulka() { // given UUID id = UUID.randomUUID(); // and - SepulkaRegReq request = sepulkaRegReq(); + SepulkaRegisterSlice command = sepulkaRegisterSlice(); // and - when(serviceMock.register(any(SepulkaRegReq.class))).thenReturn(sepulka(id)); + when(serviceMock.register(any(SepulkaRegisterSlice.class))).thenReturn(sepulka(id)); // and - SepulkaRegRes expectedResponse = sepulkaRegRes(id); + SepulkaRegisteredSlice expectedResponse = sepulkaRegisteredSlice(id); // when - SepulkaRegRes actualResponse = externalClient.register(request); + SepulkaRegisteredSlice actualResponse = externalClient.register(command); // then assertThat(actualResponse) .usingRecursiveComparison() diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientSpringWeb.java b/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientSpringWeb.java index 105ba6f8..376254d9 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientSpringWeb.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientSpringWeb.java @@ -4,21 +4,21 @@ import org.springframework.http.MediaType; import org.springframework.test.web.reactive.server.WebTestClient; import smecalculus.bezmen.messaging.client.SepulkaClient; -import smecalculus.bezmen.messaging.client.SepulkaRegReq; -import smecalculus.bezmen.messaging.client.SepulkaRegRes; +import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; +import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; public record SepulkaClientSpringWeb(@NonNull WebTestClient client, @NonNull SepulkaMsgMapper mapper) implements SepulkaClient { @Override - public SepulkaRegRes register(SepulkaRegReq request) { - SepulkaRegResMsg response = client.post() + public SepulkaRegisteredSlice register(SepulkaRegisterSlice command) { + SepulkaRegisteredSliceMsg response = client.post() .uri("/sepulkas") .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) - .bodyValue(mapper.toMsg(request)) + .bodyValue(mapper.toMsg(command)) .exchange() - .expectBody(SepulkaRegResMsg.class) + .expectBody(SepulkaRegisteredSliceMsg.class) .returnResult() .getResponseBody(); return mapper.toDomain(response); diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaConverter.java b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaConverter.java deleted file mode 100644 index 3595cac8..00000000 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaConverter.java +++ /dev/null @@ -1,7 +0,0 @@ -package smecalculus.bezmen.core; - -import smecalculus.bezmen.messaging.client.SepulkaRegRes; - -public interface SepulkaConverter { - SepulkaRegRes toRegRes(Sepulka sepulka); -} diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaService.java b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaService.java index 4da8a350..fd2ede5b 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaService.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaService.java @@ -1,10 +1,10 @@ package smecalculus.bezmen.core; import java.util.List; -import smecalculus.bezmen.messaging.client.SepulkaRegReq; +import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; public interface SepulkaService { - Sepulka register(SepulkaRegReq sepulkaRegReq); + Sepulka register(SepulkaRegisterSlice slice); List getSepulkas(); } diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaSliceMapper.java b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaSliceMapper.java new file mode 100644 index 00000000..fd2c50f2 --- /dev/null +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaSliceMapper.java @@ -0,0 +1,9 @@ +package smecalculus.bezmen.core; + +import org.mapstruct.Mapper; +import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; + +@Mapper +public interface SepulkaSliceMapper { + SepulkaRegisteredSlice toSlice(Sepulka sepulka); +} diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaClient.java b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaClient.java index abf3b4c0..6fe16585 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaClient.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaClient.java @@ -1,5 +1,5 @@ package smecalculus.bezmen.messaging.client; public interface SepulkaClient { - SepulkaRegRes register(SepulkaRegReq request); + SepulkaRegisteredSlice register(SepulkaRegisterSlice command); } diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegReqEg.java b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegReqEg.java deleted file mode 100644 index 3b91a719..00000000 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegReqEg.java +++ /dev/null @@ -1,11 +0,0 @@ -package smecalculus.bezmen.messaging.client; - -public class SepulkaRegReqEg { - public static final String NAME = "foo"; - - public static class Pojos { - public static SepulkaRegReq sepulkaRegReq() { - return new SepulkaRegReq(NAME); - } - } -} diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegResEg.java b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegResEg.java deleted file mode 100644 index c386bff4..00000000 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegResEg.java +++ /dev/null @@ -1,21 +0,0 @@ -package smecalculus.bezmen.messaging.client; - -import java.util.UUID; - -public class SepulkaRegResEg { - public static final String NAME = "foo"; - - public static class Pojos { - public static SepulkaRegRes sepulkaRegRes() { - return new SepulkaRegRes(UUID.randomUUID(), NAME); - } - - public static SepulkaRegRes sepulkaRegRes(String name) { - return new SepulkaRegRes(UUID.randomUUID(), name); - } - - public static SepulkaRegRes sepulkaRegRes(UUID id) { - return new SepulkaRegRes(id, NAME); - } - } -} diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegReq.java b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSlice.java similarity index 53% rename from libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegReq.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSlice.java index cab34c34..0a6ff4cf 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegReq.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSlice.java @@ -2,4 +2,4 @@ import lombok.NonNull; -public record SepulkaRegReq(@NonNull String name) {} +public record SepulkaRegisterSlice(@NonNull String name) {} diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSliceEg.java b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSliceEg.java new file mode 100644 index 00000000..8ece390a --- /dev/null +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSliceEg.java @@ -0,0 +1,11 @@ +package smecalculus.bezmen.messaging.client; + +public class SepulkaRegisterSliceEg { + public static final String NAME = "foo"; + + public static class Pojos { + public static SepulkaRegisterSlice sepulkaRegisterSlice() { + return new SepulkaRegisterSlice(NAME); + } + } +} diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegRes.java b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSlice.java similarity index 56% rename from libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegRes.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSlice.java index dfd805c1..46f012f9 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegRes.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSlice.java @@ -3,4 +3,4 @@ import java.util.UUID; import lombok.NonNull; -public record SepulkaRegRes(@NonNull UUID id, @NonNull String name) {} +public record SepulkaRegisteredSlice(@NonNull UUID id) {} diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSliceEg.java b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSliceEg.java new file mode 100644 index 00000000..800c753e --- /dev/null +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSliceEg.java @@ -0,0 +1,16 @@ +package smecalculus.bezmen.messaging.client; + +import java.util.UUID; + +public class SepulkaRegisteredSliceEg { + + public static class Pojos { + public static SepulkaRegisteredSlice sepulkaRegisteredSlice() { + return new SepulkaRegisteredSlice(UUID.randomUUID()); + } + + public static SepulkaRegisteredSlice sepulkaRegisteredSlice(UUID id) { + return new SepulkaRegisteredSlice(id); + } + } +} diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/messaging/client/BezmenClientJavaHttp.java b/libs/messaging/src/main/java/smecalculus/bezmen/messaging/client/BezmenClientJavaHttp.java index 1e639212..4503252d 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/messaging/client/BezmenClientJavaHttp.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/messaging/client/BezmenClientJavaHttp.java @@ -13,9 +13,9 @@ public record BezmenClientJavaHttp(ObjectMapper mapper, HttpClient client) implements BezmenClient { @Override - public SepulkaRegRes register(SepulkaRegReq request) { + public SepulkaRegisteredSlice register(SepulkaRegisterSlice command) { try { - String jsonRequest = mapper.writeValueAsString(request); + String jsonRequest = mapper.writeValueAsString(command); HttpRequest httpRequest = HttpRequest.newBuilder() .uri(URI.create("http://localhost:8080/sepulkas")) .POST(BodyPublishers.ofString(jsonRequest)) @@ -23,7 +23,7 @@ public SepulkaRegRes register(SepulkaRegReq request) { .header("Accept", "application/json") .build(); HttpResponse httpResponse = client.send(httpRequest, BodyHandlers.ofString()); - return mapper.readValue(httpResponse.body(), SepulkaRegRes.class); + return mapper.readValue(httpResponse.body(), SepulkaRegisteredSlice.class); } catch (JsonProcessingException e) { throw new RuntimeException(e); } catch (IOException | InterruptedException e) { diff --git a/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java b/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java index 67a2a283..c5985829 100644 --- a/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java +++ b/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java @@ -3,8 +3,7 @@ import static java.time.Duration.ofSeconds; import static org.assertj.core.api.Assertions.assertThat; import static org.awaitility.Awaitility.await; -import static smecalculus.bezmen.messaging.client.SepulkaRegReqEg.Pojos.sepulkaRegReq; -import static smecalculus.bezmen.messaging.client.SepulkaRegResEg.Pojos.sepulkaRegRes; +import static smecalculus.bezmen.messaging.client.SepulkaRegisterSliceEg.Pojos.sepulkaRegisterSlice; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Tag; @@ -16,8 +15,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import smecalculus.bezmen.StandBeans; import smecalculus.bezmen.messaging.client.BezmenClient; -import smecalculus.bezmen.messaging.client.SepulkaRegReq; -import smecalculus.bezmen.messaging.client.SepulkaRegRes; +import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; +import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; +import smecalculus.bezmen.messaging.client.SepulkaRegisteredSliceEg; @ExtendWith(SpringExtension.class) @ContextConfiguration(classes = StandBeans.class) @@ -35,11 +35,11 @@ void beforeAll() { @Tag("smoke") void shouldRegisterSepulka() { // given - SepulkaRegReq request = sepulkaRegReq(); + SepulkaRegisterSlice request = sepulkaRegisterSlice(); // and - SepulkaRegRes expectedResponse = sepulkaRegRes(); + SepulkaRegisteredSlice expectedResponse = SepulkaRegisteredSliceEg.Pojos.sepulkaRegisteredSlice(); // when - SepulkaRegRes actualResponse = bezmenClient.register(request); + SepulkaRegisteredSlice actualResponse = bezmenClient.register(request); // then assertThat(actualResponse) .usingRecursiveComparison() From 5fc61087a0990ba20ad0d432f4c543a7cf19d13a Mon Sep 17 00:00:00 2001 From: Pavel Vetokhin Date: Sat, 7 Oct 2023 18:43:49 +0300 Subject: [PATCH 2/5] Introduce exterior & interior distinction --- apps/pom.xml | 5 +- apps/sepuling/Dockerfile | 2 +- .../{ => interior}/construction/App.java | 42 +++++++-------- .../core/SepulkaServiceImpl.java | 9 ++-- .../interior/messaging/SepulkaClientImpl.java | 19 +++++++ .../springmvc/SepulkaController.java | 22 ++++---- .../{ => interior}/storage/SepulkaDao.java | 4 +- .../storage/SepulkaDaoMyBatis.java | 6 +-- .../storage/SepulkaDaoSpringData.java | 6 +-- .../{ => interior}/storage/SepulkaRec.java | 2 +- .../storage/SepulkaRecMapper.java | 4 +- .../storage/mybatis/SepulkaSqlMapper.java | 4 +- .../storage/springdata/SepulkaRepository.java | 4 +- .../bezmen/messaging/SepulkaClientImpl.java | 19 ------- .../construction/SepulkaClientBeans.java | 22 ++++---- .../construction/SepulkaDaoBeans.java | 28 +++++----- .../messaging/SepulkaClientIT.java | 18 +++---- .../messaging/SepulkaClientSpringWeb.java | 11 ++-- .../messaging/SepulkaClientSpringWebIT.java | 2 +- .../{ => interior}/storage/SepulkaDaoIT.java | 8 +-- .../storage/SepulkaDaoMyBatisPostgresIT.java | 6 +-- .../storage/SepulkaDaoMyBatisTest.java | 2 +- .../SepulkaDaoSpringDataPostgresIT.java | 6 +-- libs/abstraction/pom.xml | 9 +--- .../messaging}/BezmenClient.java | 2 +- .../messaging}/SepulingClient.java | 2 +- .../messaging}/SepulkaClient.java | 2 +- .../exterior}/messaging/SepulkaMsgMapper.java | 4 +- .../messaging}/SepulkaRegisterSlice.java | 2 +- .../messaging}/SepulkaRegisterSliceEg.java | 2 +- .../messaging/SepulkaRegisterSliceMsg.java | 2 +- .../messaging}/SepulkaRegisteredSlice.java | 2 +- .../messaging}/SepulkaRegisteredSliceEg.java | 2 +- .../messaging/SepulkaRegisteredSliceMsg.java | 2 +- .../configuration/ConfigKeeper.java | 2 +- .../bezmen/{ => interior}/core/Sepulka.java | 2 +- .../bezmen/{ => interior}/core/SepulkaEg.java | 2 +- .../{ => interior}/core/SepulkaService.java | 4 +- .../core/SepulkaSliceMapper.java | 4 +- .../validation/EdgeValidator.java | 2 +- libs/essentials/pom.xml | 15 +----- .../bezmen/construction/ConfigBeans.java | 31 ----------- .../ConfigKeeperLightbendConfig.java | 2 +- .../ConfigKeeperSpringConfig.java | 2 +- .../configuration/ConfigMappingMode.java | 2 +- .../configuration/ConfigProtocolMode.java | 2 +- .../ConditionalOnConfigMappingMode.java | 4 +- .../ConditionalOnConfigProtocolMode.java | 4 +- .../interior/construction/ConfigBeans.java | 29 ++++++++++ .../ConfigMappingModeCondition.java | 4 +- .../ConfigProtocolModeCondition.java | 4 +- .../construction/ValidationBeans.java | 8 +-- .../EdgeValidatorHibernateValidator.java | 2 +- .../validation/ValueOfEnum.java | 2 +- .../validation/ValueOfEnumValidator.java | 2 +- .../bezmen/modeling/Sepulcarium.kt | 3 -- libs/messaging/pom.xml | 9 +--- .../MappingSpringWebMvcBeans.java | 13 ----- .../messaging}/BezmenClientJavaHttp.java | 20 ++++--- .../configuration/MessageMappingMode.java | 2 +- .../configuration/MessageMappingProps.java | 2 +- .../configuration/MessageMappingPropsCfg.java | 4 +- .../configuration/MessageMappingPropsEg.java | 6 +-- .../configuration/MessagingCfgMapper.java | 2 +- .../configuration/MessagingProps.java | 2 +- .../configuration/MessagingPropsCfg.java | 2 +- .../configuration/MessagingPropsEg.java | 6 +-- .../configuration/MessagingProtocolMode.java | 2 +- .../configuration/MessagingProtocolProps.java | 2 +- .../MessagingProtocolPropsCfg.java | 4 +- .../MessagingProtocolPropsEg.java | 4 +- .../ConditionalOnMessageMappingModes.java | 4 +- .../ConditionalOnMessagingProtocolModes.java | 4 +- .../MappingSpringJmxManagementBeans.java | 6 +-- .../MappingSpringWebManagementBeans.java | 6 +-- .../MappingSpringWebMvcBeans.java | 12 +++++ .../MessageMappingModeCondition.java | 6 +-- .../construction/MessagingBeans.java | 2 +- .../construction/MessagingConfigBeans.java | 14 ++--- .../MessagingProtocolModeCondition.java | 6 +-- .../construction/ProtocolHttpBeans.java | 7 ++- .../construction/ProtocolJmxBeans.java | 4 +- .../construction/MessagingConfigBeansIT.java | 6 +-- ...MessagingConfigBeansLightbendConfigIT.java | 2 +- .../MessagingConfigBeansSpringConfigIT.java | 2 +- libs/pom.xml | 53 ++++++------------- .../{ => interior}/configuration/H2Props.java | 2 +- .../configuration/H2PropsCfg.java | 2 +- .../configuration/PostgresProps.java | 2 +- .../configuration/PostgresPropsCfg.java | 2 +- .../configuration/StateMappingMode.java | 2 +- .../configuration/StateMappingProps.java | 2 +- .../configuration/StateMappingPropsCfg.java | 4 +- .../configuration/StateMappingPropsEg.java | 4 +- .../configuration/StorageCfgMapper.java | 2 +- .../configuration/StorageProps.java | 2 +- .../configuration/StoragePropsCfg.java | 2 +- .../configuration/StoragePropsEg.java | 10 ++-- .../configuration/StorageProtocolMode.java | 2 +- .../configuration/StorageProtocolProps.java | 2 +- .../StorageProtocolPropsCfg.java | 4 +- .../configuration/StorageProtocolPropsEg.java | 2 +- .../ConditionalOnStateMappingMode.java | 4 +- .../construction/MappingMyBatisBeans.java | 4 +- .../construction/MappingSpringDataBeans.java | 10 ++-- .../StateMappingModeCondition.java | 6 +-- .../construction/StorageBeans.java | 10 ++-- .../construction/StorageConfigBeans.java | 14 ++--- .../construction/StorageConfigBeansIT.java | 6 +-- .../StorageConfigBeansLightbendConfigIT.java | 2 +- .../StorageConfigBeansSpringConfigIT.java | 2 +- .../construction/StorageConfigBeansTest.java | 14 ++--- libs/testing/pom.xml | 9 ++-- .../construction/TestingBeans.java | 2 +- .../testing/ShardingExtension.java | 2 +- .../org.junit.jupiter.api.extension.Extension | 2 +- .../java/smecalculus/bezmen/StandBeans.java | 11 ++-- .../bezmen/registration/SepulkaTest.java | 10 ++-- tests/pom.xml | 3 +- 119 files changed, 367 insertions(+), 418 deletions(-) rename apps/sepuling/src/main/java/smecalculus/bezmen/{ => interior}/construction/App.java (57%) rename apps/sepuling/src/main/java/smecalculus/bezmen/{ => interior}/core/SepulkaServiceImpl.java (61%) create mode 100644 apps/sepuling/src/main/java/smecalculus/bezmen/interior/messaging/SepulkaClientImpl.java rename apps/sepuling/src/main/java/smecalculus/bezmen/{ => interior}/messaging/springmvc/SepulkaController.java (53%) rename apps/sepuling/src/main/java/smecalculus/bezmen/{ => interior}/storage/SepulkaDao.java (65%) rename apps/sepuling/src/main/java/smecalculus/bezmen/{ => interior}/storage/SepulkaDaoMyBatis.java (82%) rename apps/sepuling/src/main/java/smecalculus/bezmen/{ => interior}/storage/SepulkaDaoSpringData.java (84%) rename apps/sepuling/src/main/java/smecalculus/bezmen/{ => interior}/storage/SepulkaRec.java (87%) rename apps/sepuling/src/main/java/smecalculus/bezmen/{ => interior}/storage/SepulkaRecMapper.java (63%) rename apps/sepuling/src/main/java/smecalculus/bezmen/{ => interior}/storage/mybatis/SepulkaSqlMapper.java (83%) rename apps/sepuling/src/main/java/smecalculus/bezmen/{ => interior}/storage/springdata/SepulkaRepository.java (56%) delete mode 100644 apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java rename apps/sepuling/src/test/java/smecalculus/bezmen/{ => interior}/construction/SepulkaClientBeans.java (64%) rename apps/sepuling/src/test/java/smecalculus/bezmen/{ => interior}/construction/SepulkaDaoBeans.java (75%) rename apps/sepuling/src/test/java/smecalculus/bezmen/{ => interior}/messaging/SepulkaClientIT.java (67%) rename apps/sepuling/src/test/java/smecalculus/bezmen/{ => interior}/messaging/SepulkaClientSpringWeb.java (61%) rename apps/sepuling/src/test/java/smecalculus/bezmen/{ => interior}/messaging/SepulkaClientSpringWebIT.java (58%) rename apps/sepuling/src/test/java/smecalculus/bezmen/{ => interior}/storage/SepulkaDaoIT.java (81%) rename apps/sepuling/src/test/java/smecalculus/bezmen/{ => interior}/storage/SepulkaDaoMyBatisPostgresIT.java (56%) rename apps/sepuling/src/test/java/smecalculus/bezmen/{ => interior}/storage/SepulkaDaoMyBatisTest.java (68%) rename apps/sepuling/src/test/java/smecalculus/bezmen/{ => interior}/storage/SepulkaDaoSpringDataPostgresIT.java (56%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{messaging/client => exterior/messaging}/BezmenClient.java (54%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{messaging/client => exterior/messaging}/SepulingClient.java (61%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{messaging/client => exterior/messaging}/SepulkaClient.java (68%) rename {apps/sepuling/src/main/java/smecalculus/bezmen => libs/abstraction/src/main/java/smecalculus/bezmen/exterior}/messaging/SepulkaMsgMapper.java (67%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{messaging/client => exterior/messaging}/SepulkaRegisterSlice.java (64%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{messaging/client => exterior/messaging}/SepulkaRegisterSliceEg.java (84%) rename {apps/sepuling/src/main/java/smecalculus/bezmen => libs/abstraction/src/main/java/smecalculus/bezmen/exterior}/messaging/SepulkaRegisterSliceMsg.java (66%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{messaging/client => exterior/messaging}/SepulkaRegisteredSlice.java (69%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{messaging/client => exterior/messaging}/SepulkaRegisteredSliceEg.java (89%) rename {apps/sepuling/src/main/java/smecalculus/bezmen => libs/abstraction/src/main/java/smecalculus/bezmen/exterior}/messaging/SepulkaRegisteredSliceMsg.java (66%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{ => interior}/configuration/ConfigKeeper.java (60%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{ => interior}/core/Sepulka.java (77%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{ => interior}/core/SepulkaEg.java (93%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{ => interior}/core/SepulkaService.java (57%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{ => interior}/core/SepulkaSliceMapper.java (54%) rename libs/abstraction/src/main/java/smecalculus/bezmen/{ => interior}/validation/EdgeValidator.java (64%) delete mode 100644 libs/essentials/src/main/java/smecalculus/bezmen/construction/ConfigBeans.java rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/configuration/ConfigKeeperLightbendConfig.java (85%) rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/configuration/ConfigKeeperSpringConfig.java (87%) rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/configuration/ConfigMappingMode.java (59%) rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/configuration/ConfigProtocolMode.java (50%) rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/construction/ConditionalOnConfigMappingMode.java (78%) rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/construction/ConditionalOnConfigProtocolMode.java (78%) create mode 100644 libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConfigBeans.java rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/construction/ConfigMappingModeCondition.java (89%) rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/construction/ConfigProtocolModeCondition.java (89%) rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/construction/ValidationBeans.java (64%) rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/validation/EdgeValidatorHibernateValidator.java (92%) rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/validation/ValueOfEnum.java (93%) rename libs/essentials/src/main/java/smecalculus/bezmen/{ => interior}/validation/ValueOfEnumValidator.java (95%) delete mode 100644 libs/essentials/src/main/kotlin/smecalculus/bezmen/modeling/Sepulcarium.kt delete mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebMvcBeans.java rename libs/messaging/src/main/java/smecalculus/bezmen/{messaging/client => exterior/messaging}/BezmenClientJavaHttp.java (67%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessageMappingMode.java (59%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessageMappingProps.java (76%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessageMappingPropsCfg.java (71%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessageMappingPropsEg.java (64%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessagingCfgMapper.java (94%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessagingProps.java (78%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessagingPropsCfg.java (80%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessagingPropsEg.java (54%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessagingProtocolMode.java (52%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessagingProtocolProps.java (76%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessagingProtocolPropsCfg.java (71%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/configuration/MessagingProtocolPropsEg.java (67%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/construction/ConditionalOnMessageMappingModes.java (78%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/construction/ConditionalOnMessagingProtocolModes.java (78%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/construction/MappingSpringJmxManagementBeans.java (52%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/construction/MappingSpringWebManagementBeans.java (82%) create mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringWebMvcBeans.java rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/construction/MessageMappingModeCondition.java (86%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/construction/MessagingBeans.java (89%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/construction/MessagingConfigBeans.java (66%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/construction/MessagingProtocolModeCondition.java (86%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/construction/ProtocolHttpBeans.java (73%) rename libs/messaging/src/main/java/smecalculus/bezmen/{ => interior}/construction/ProtocolJmxBeans.java (73%) rename libs/messaging/src/test/java/smecalculus/bezmen/{ => interior}/construction/MessagingConfigBeansIT.java (79%) rename libs/messaging/src/test/java/smecalculus/bezmen/{ => interior}/construction/MessagingConfigBeansLightbendConfigIT.java (81%) rename libs/messaging/src/test/java/smecalculus/bezmen/{ => interior}/construction/MessagingConfigBeansSpringConfigIT.java (81%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/H2Props.java (79%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/H2PropsCfg.java (80%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/PostgresProps.java (80%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/PostgresPropsCfg.java (83%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StateMappingMode.java (55%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StateMappingProps.java (66%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StateMappingPropsCfg.java (54%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StateMappingPropsEg.java (78%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StorageCfgMapper.java (94%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StorageProps.java (77%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StoragePropsCfg.java (80%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StoragePropsEg.java (58%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StorageProtocolMode.java (53%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StorageProtocolProps.java (83%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StorageProtocolPropsCfg.java (69%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/configuration/StorageProtocolPropsEg.java (95%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/construction/ConditionalOnStateMappingMode.java (78%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/construction/MappingMyBatisBeans.java (84%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/construction/MappingSpringDataBeans.java (81%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/construction/StateMappingModeCondition.java (84%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/construction/StorageBeans.java (83%) rename libs/storage/src/main/java/smecalculus/bezmen/{ => interior}/construction/StorageConfigBeans.java (66%) rename libs/storage/src/test/java/smecalculus/bezmen/{ => interior}/construction/StorageConfigBeansIT.java (79%) rename libs/storage/src/test/java/smecalculus/bezmen/{ => interior}/construction/StorageConfigBeansLightbendConfigIT.java (81%) rename libs/storage/src/test/java/smecalculus/bezmen/{ => interior}/construction/StorageConfigBeansSpringConfigIT.java (80%) rename libs/storage/src/test/java/smecalculus/bezmen/{ => interior}/construction/StorageConfigBeansTest.java (67%) rename libs/testing/src/main/java/smecalculus/bezmen/{ => interior}/construction/TestingBeans.java (93%) rename libs/testing/src/main/java/smecalculus/bezmen/{ => interior}/testing/ShardingExtension.java (96%) diff --git a/apps/pom.xml b/apps/pom.xml index 2d0e0166..b4903d35 100644 --- a/apps/pom.xml +++ b/apps/pom.xml @@ -83,9 +83,7 @@ maven-compiler-plugin 3.11.0 - 17 - 17 - UTF-8 + 17 org.projectlombok @@ -166,7 +164,6 @@ *.xml *.yml - *.properties Dockerfile diff --git a/apps/sepuling/Dockerfile b/apps/sepuling/Dockerfile index 8604baea..04e95771 100644 --- a/apps/sepuling/Dockerfile +++ b/apps/sepuling/Dockerfile @@ -7,5 +7,5 @@ COPY sepuling*.jar app.jar ENTRYPOINT [ \ "java", "-cp", "app.jar:libs/*", \ "-Dconfig.file=application.conf", \ - "smecalculus.bezmen.construction.App" \ + "smecalculus.bezmen.interior.construction.App" \ ] diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/construction/App.java similarity index 57% rename from apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/interior/construction/App.java index 7af778c4..10b134bb 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/construction/App.java @@ -1,31 +1,31 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; -import static smecalculus.bezmen.configuration.MessageMappingMode.SPRING_MVC; -import static smecalculus.bezmen.configuration.StateMappingMode.MY_BATIS; -import static smecalculus.bezmen.configuration.StateMappingMode.SPRING_DATA; +import static smecalculus.bezmen.interior.configuration.MessageMappingMode.SPRING_MVC; +import static smecalculus.bezmen.interior.configuration.StateMappingMode.MY_BATIS; +import static smecalculus.bezmen.interior.configuration.StateMappingMode.SPRING_DATA; import org.springframework.boot.SpringApplication; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.PropertySource; -import smecalculus.bezmen.core.SepulkaService; -import smecalculus.bezmen.core.SepulkaServiceImpl; -import smecalculus.bezmen.core.SepulkaSliceMapper; -import smecalculus.bezmen.core.SepulkaSliceMapperImpl; -import smecalculus.bezmen.messaging.SepulkaClientImpl; -import smecalculus.bezmen.messaging.SepulkaMsgMapper; -import smecalculus.bezmen.messaging.SepulkaMsgMapperImpl; -import smecalculus.bezmen.messaging.client.SepulkaClient; -import smecalculus.bezmen.messaging.springmvc.SepulkaController; -import smecalculus.bezmen.storage.SepulkaDao; -import smecalculus.bezmen.storage.SepulkaDaoMyBatis; -import smecalculus.bezmen.storage.SepulkaDaoSpringData; -import smecalculus.bezmen.storage.SepulkaRecMapper; -import smecalculus.bezmen.storage.SepulkaRecMapperImpl; -import smecalculus.bezmen.storage.mybatis.SepulkaSqlMapper; -import smecalculus.bezmen.storage.springdata.SepulkaRepository; -import smecalculus.bezmen.validation.EdgeValidator; +import smecalculus.bezmen.exterior.messaging.SepulkaClient; +import smecalculus.bezmen.exterior.messaging.SepulkaMsgMapper; +import smecalculus.bezmen.exterior.messaging.SepulkaMsgMapperImpl; +import smecalculus.bezmen.interior.core.SepulkaService; +import smecalculus.bezmen.interior.core.SepulkaServiceImpl; +import smecalculus.bezmen.interior.core.SepulkaSliceMapper; +import smecalculus.bezmen.interior.core.SepulkaSliceMapperImpl; +import smecalculus.bezmen.interior.messaging.SepulkaClientImpl; +import smecalculus.bezmen.interior.messaging.springmvc.SepulkaController; +import smecalculus.bezmen.interior.storage.SepulkaDao; +import smecalculus.bezmen.interior.storage.SepulkaDaoMyBatis; +import smecalculus.bezmen.interior.storage.SepulkaDaoSpringData; +import smecalculus.bezmen.interior.storage.SepulkaRecMapper; +import smecalculus.bezmen.interior.storage.SepulkaRecMapperImpl; +import smecalculus.bezmen.interior.storage.mybatis.SepulkaSqlMapper; +import smecalculus.bezmen.interior.storage.springdata.SepulkaRepository; +import smecalculus.bezmen.interior.validation.EdgeValidator; @Import({ValidationBeans.class, ConfigBeans.class, MessagingBeans.class, StorageBeans.class}) @PropertySource("classpath:application.properties") diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/core/SepulkaServiceImpl.java similarity index 61% rename from apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/interior/core/SepulkaServiceImpl.java index 9ca64422..e0e2fe90 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/core/SepulkaServiceImpl.java @@ -1,18 +1,17 @@ -package smecalculus.bezmen.core; +package smecalculus.bezmen.interior.core; import static java.util.UUID.randomUUID; import java.util.List; import lombok.NonNull; -import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; -import smecalculus.bezmen.storage.SepulkaDao; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisterSlice; +import smecalculus.bezmen.interior.storage.SepulkaDao; public record SepulkaServiceImpl(@NonNull SepulkaDao sepulkaDao) implements SepulkaService { @Override public Sepulka register(SepulkaRegisterSlice slice) { - Sepulka sepulka = - Sepulka.builder().id(randomUUID()).name(slice.name()).build(); + Sepulka sepulka = Sepulka.builder().id(randomUUID()).name(slice.name()).build(); return sepulkaDao.save(sepulka); } diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/interior/messaging/SepulkaClientImpl.java b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/messaging/SepulkaClientImpl.java new file mode 100644 index 00000000..50ec3109 --- /dev/null +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/messaging/SepulkaClientImpl.java @@ -0,0 +1,19 @@ +package smecalculus.bezmen.interior.messaging; + +import lombok.NonNull; +import smecalculus.bezmen.exterior.messaging.SepulkaClient; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisterSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSlice; +import smecalculus.bezmen.interior.core.Sepulka; +import smecalculus.bezmen.interior.core.SepulkaService; +import smecalculus.bezmen.interior.core.SepulkaSliceMapper; + +public record SepulkaClientImpl(@NonNull SepulkaService service, @NonNull SepulkaSliceMapper mapper) + implements SepulkaClient { + + @Override + public SepulkaRegisteredSlice register(SepulkaRegisterSlice request) { + Sepulka sepulka = service.register(request); + return mapper.toSlice(sepulka); + } +} diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/springmvc/SepulkaController.java b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/messaging/springmvc/SepulkaController.java similarity index 53% rename from apps/sepuling/src/main/java/smecalculus/bezmen/messaging/springmvc/SepulkaController.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/interior/messaging/springmvc/SepulkaController.java index dd51b8fd..f8335cc8 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/springmvc/SepulkaController.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/messaging/springmvc/SepulkaController.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.messaging.springmvc; +package smecalculus.bezmen.interior.messaging.springmvc; import lombok.NonNull; import org.springframework.http.HttpStatus; @@ -7,13 +7,13 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import smecalculus.bezmen.messaging.SepulkaMsgMapper; -import smecalculus.bezmen.messaging.SepulkaRegisterSliceMsg; -import smecalculus.bezmen.messaging.SepulkaRegisteredSliceMsg; -import smecalculus.bezmen.messaging.client.SepulkaClient; -import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; -import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; -import smecalculus.bezmen.validation.EdgeValidator; +import smecalculus.bezmen.exterior.messaging.SepulkaClient; +import smecalculus.bezmen.exterior.messaging.SepulkaMsgMapper; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisterSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisterSliceMsg; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSliceMsg; +import smecalculus.bezmen.interior.validation.EdgeValidator; @RestController @RequestMapping("sepulkas") @@ -23,8 +23,8 @@ public record SepulkaController( @PostMapping ResponseEntity register(@RequestBody SepulkaRegisterSliceMsg sliceMsg) { validator.validate(sliceMsg); - SepulkaRegisterSlice registerSlice = mapper.toDomain(sliceMsg); - SepulkaRegisteredSlice registeredSlice = client.register(registerSlice); - return ResponseEntity.status(HttpStatus.CREATED).body(mapper.toMsg(registeredSlice)); + SepulkaRegisterSlice requestSlice = mapper.toDomain(sliceMsg); + SepulkaRegisteredSlice responseSlice = client.register(requestSlice); + return ResponseEntity.status(HttpStatus.CREATED).body(mapper.toMsg(responseSlice)); } } diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDao.java b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaDao.java similarity index 65% rename from apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDao.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaDao.java index 32a13ccb..e0423d41 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDao.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaDao.java @@ -1,8 +1,8 @@ -package smecalculus.bezmen.storage; +package smecalculus.bezmen.interior.storage; import java.util.List; import java.util.UUID; -import smecalculus.bezmen.core.Sepulka; +import smecalculus.bezmen.interior.core.Sepulka; public interface SepulkaDao { diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoMyBatis.java b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaDaoMyBatis.java similarity index 82% rename from apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoMyBatis.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaDaoMyBatis.java index 7f55a067..da937ef8 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoMyBatis.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaDaoMyBatis.java @@ -1,12 +1,12 @@ -package smecalculus.bezmen.storage; +package smecalculus.bezmen.interior.storage; import static java.util.stream.Collectors.toList; import java.util.List; import java.util.UUID; import lombok.NonNull; -import smecalculus.bezmen.core.Sepulka; -import smecalculus.bezmen.storage.mybatis.SepulkaSqlMapper; +import smecalculus.bezmen.interior.core.Sepulka; +import smecalculus.bezmen.interior.storage.mybatis.SepulkaSqlMapper; public record SepulkaDaoMyBatis(@NonNull SepulkaRecMapper recMapper, @NonNull SepulkaSqlMapper sqlMapper) implements SepulkaDao { diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoSpringData.java b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaDaoSpringData.java similarity index 84% rename from apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoSpringData.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaDaoSpringData.java index 74a111bc..960049ee 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoSpringData.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaDaoSpringData.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.storage; +package smecalculus.bezmen.interior.storage; import static java.util.stream.Collectors.toList; import static java.util.stream.StreamSupport.stream; @@ -6,8 +6,8 @@ import java.util.List; import java.util.UUID; import lombok.NonNull; -import smecalculus.bezmen.core.Sepulka; -import smecalculus.bezmen.storage.springdata.SepulkaRepository; +import smecalculus.bezmen.interior.core.Sepulka; +import smecalculus.bezmen.interior.storage.springdata.SepulkaRepository; public record SepulkaDaoSpringData(@NonNull SepulkaRecMapper mapper, @NonNull SepulkaRepository repository) implements SepulkaDao { diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaRec.java b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaRec.java similarity index 87% rename from apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaRec.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaRec.java index 9a2400e1..29c2e7c9 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaRec.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaRec.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.storage; +package smecalculus.bezmen.interior.storage; import lombok.Data; import org.springframework.data.annotation.Id; diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaRecMapper.java b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaRecMapper.java similarity index 63% rename from apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaRecMapper.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaRecMapper.java index 3bc8ccf1..7ffcb90d 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaRecMapper.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/SepulkaRecMapper.java @@ -1,7 +1,7 @@ -package smecalculus.bezmen.storage; +package smecalculus.bezmen.interior.storage; import org.mapstruct.Mapper; -import smecalculus.bezmen.core.Sepulka; +import smecalculus.bezmen.interior.core.Sepulka; @Mapper public interface SepulkaRecMapper { diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/mybatis/SepulkaSqlMapper.java b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/mybatis/SepulkaSqlMapper.java similarity index 83% rename from apps/sepuling/src/main/java/smecalculus/bezmen/storage/mybatis/SepulkaSqlMapper.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/mybatis/SepulkaSqlMapper.java index d617ecc4..809b23dc 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/mybatis/SepulkaSqlMapper.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/mybatis/SepulkaSqlMapper.java @@ -1,11 +1,11 @@ -package smecalculus.bezmen.storage.mybatis; +package smecalculus.bezmen.interior.storage.mybatis; import java.util.List; import java.util.Optional; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; -import smecalculus.bezmen.storage.SepulkaRec; +import smecalculus.bezmen.interior.storage.SepulkaRec; public interface SepulkaSqlMapper { diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/springdata/SepulkaRepository.java b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/springdata/SepulkaRepository.java similarity index 56% rename from apps/sepuling/src/main/java/smecalculus/bezmen/storage/springdata/SepulkaRepository.java rename to apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/springdata/SepulkaRepository.java index 947734b8..98412922 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/springdata/SepulkaRepository.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/interior/storage/springdata/SepulkaRepository.java @@ -1,6 +1,6 @@ -package smecalculus.bezmen.storage.springdata; +package smecalculus.bezmen.interior.storage.springdata; import org.springframework.data.repository.CrudRepository; -import smecalculus.bezmen.storage.SepulkaRec; +import smecalculus.bezmen.interior.storage.SepulkaRec; public interface SepulkaRepository extends CrudRepository {} diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java deleted file mode 100644 index df2d839a..00000000 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package smecalculus.bezmen.messaging; - -import lombok.NonNull; -import smecalculus.bezmen.core.Sepulka; -import smecalculus.bezmen.core.SepulkaService; -import smecalculus.bezmen.core.SepulkaSliceMapper; -import smecalculus.bezmen.messaging.client.SepulkaClient; -import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; -import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; - -public record SepulkaClientImpl(@NonNull SepulkaService service, @NonNull SepulkaSliceMapper mapper) - implements SepulkaClient { - - @Override - public SepulkaRegisteredSlice register(SepulkaRegisterSlice command) { - Sepulka sepulka = service.register(command); - return mapper.toSlice(sepulka); - } -} diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaClientBeans.java b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/construction/SepulkaClientBeans.java similarity index 64% rename from apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaClientBeans.java rename to apps/sepuling/src/test/java/smecalculus/bezmen/interior/construction/SepulkaClientBeans.java index 4d829d95..7e500c2e 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaClientBeans.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/construction/SepulkaClientBeans.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import static org.mockito.Mockito.mock; @@ -7,16 +7,16 @@ import org.springframework.context.annotation.Import; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.servlet.client.MockMvcWebTestClient; -import smecalculus.bezmen.core.SepulkaService; -import smecalculus.bezmen.core.SepulkaSliceMapper; -import smecalculus.bezmen.core.SepulkaSliceMapperImpl; -import smecalculus.bezmen.messaging.SepulkaClientImpl; -import smecalculus.bezmen.messaging.SepulkaClientSpringWeb; -import smecalculus.bezmen.messaging.SepulkaMsgMapper; -import smecalculus.bezmen.messaging.SepulkaMsgMapperImpl; -import smecalculus.bezmen.messaging.client.SepulkaClient; -import smecalculus.bezmen.messaging.springmvc.SepulkaController; -import smecalculus.bezmen.validation.EdgeValidator; +import smecalculus.bezmen.exterior.messaging.SepulkaClient; +import smecalculus.bezmen.exterior.messaging.SepulkaMsgMapper; +import smecalculus.bezmen.exterior.messaging.SepulkaMsgMapperImpl; +import smecalculus.bezmen.interior.core.SepulkaService; +import smecalculus.bezmen.interior.core.SepulkaSliceMapper; +import smecalculus.bezmen.interior.core.SepulkaSliceMapperImpl; +import smecalculus.bezmen.interior.messaging.SepulkaClientImpl; +import smecalculus.bezmen.interior.messaging.SepulkaClientSpringWeb; +import smecalculus.bezmen.interior.messaging.springmvc.SepulkaController; +import smecalculus.bezmen.interior.validation.EdgeValidator; @Import(ValidationBeans.class) @Configuration(proxyBeanMethods = false) diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaDaoBeans.java b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/construction/SepulkaDaoBeans.java similarity index 75% rename from apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaDaoBeans.java rename to apps/sepuling/src/test/java/smecalculus/bezmen/interior/construction/SepulkaDaoBeans.java index 74305fd5..c5f22d1b 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaDaoBeans.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/construction/SepulkaDaoBeans.java @@ -1,9 +1,9 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import static java.util.stream.Collectors.joining; -import static smecalculus.bezmen.configuration.StateMappingMode.MY_BATIS; -import static smecalculus.bezmen.configuration.StateMappingMode.SPRING_DATA; -import static smecalculus.bezmen.configuration.StorageProtocolMode.POSTGRES; +import static smecalculus.bezmen.interior.configuration.StateMappingMode.MY_BATIS; +import static smecalculus.bezmen.interior.configuration.StateMappingMode.SPRING_DATA; +import static smecalculus.bezmen.interior.configuration.StorageProtocolMode.POSTGRES; import java.util.Collection; import java.util.List; @@ -13,16 +13,16 @@ import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType; -import smecalculus.bezmen.configuration.StateMappingProps; -import smecalculus.bezmen.configuration.StorageProps; -import smecalculus.bezmen.configuration.StorageProtocolProps; -import smecalculus.bezmen.storage.SepulkaDao; -import smecalculus.bezmen.storage.SepulkaDaoMyBatis; -import smecalculus.bezmen.storage.SepulkaDaoSpringData; -import smecalculus.bezmen.storage.SepulkaRecMapper; -import smecalculus.bezmen.storage.SepulkaRecMapperImpl; -import smecalculus.bezmen.storage.mybatis.SepulkaSqlMapper; -import smecalculus.bezmen.storage.springdata.SepulkaRepository; +import smecalculus.bezmen.interior.configuration.StateMappingProps; +import smecalculus.bezmen.interior.configuration.StorageProps; +import smecalculus.bezmen.interior.configuration.StorageProtocolProps; +import smecalculus.bezmen.interior.storage.SepulkaDao; +import smecalculus.bezmen.interior.storage.SepulkaDaoMyBatis; +import smecalculus.bezmen.interior.storage.SepulkaDaoSpringData; +import smecalculus.bezmen.interior.storage.SepulkaRecMapper; +import smecalculus.bezmen.interior.storage.SepulkaRecMapperImpl; +import smecalculus.bezmen.interior.storage.mybatis.SepulkaSqlMapper; +import smecalculus.bezmen.interior.storage.springdata.SepulkaRepository; @Configuration(proxyBeanMethods = false) public class SepulkaDaoBeans { diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientIT.java b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientIT.java similarity index 67% rename from apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientIT.java rename to apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientIT.java index 19694404..0fba37f3 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientIT.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientIT.java @@ -1,11 +1,11 @@ -package smecalculus.bezmen.messaging; +package smecalculus.bezmen.interior.messaging; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; -import static smecalculus.bezmen.core.SepulkaEg.Pojos.sepulka; -import static smecalculus.bezmen.messaging.client.SepulkaRegisterSliceEg.Pojos.sepulkaRegisterSlice; -import static smecalculus.bezmen.messaging.client.SepulkaRegisteredSliceEg.Pojos.sepulkaRegisteredSlice; +import static smecalculus.bezmen.exterior.messaging.SepulkaRegisterSliceEg.Pojos.sepulkaRegisterSlice; +import static smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSliceEg.Pojos.sepulkaRegisteredSlice; +import static smecalculus.bezmen.interior.core.SepulkaEg.Pojos.sepulka; import java.util.UUID; import org.junit.jupiter.api.Test; @@ -13,11 +13,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; -import smecalculus.bezmen.construction.SepulkaClientBeans; -import smecalculus.bezmen.core.SepulkaService; -import smecalculus.bezmen.messaging.client.SepulkaClient; -import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; -import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaClient; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisterSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSlice; +import smecalculus.bezmen.interior.construction.SepulkaClientBeans; +import smecalculus.bezmen.interior.core.SepulkaService; @ExtendWith(SpringExtension.class) @ContextConfiguration(classes = SepulkaClientBeans.class) diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientSpringWeb.java b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWeb.java similarity index 61% rename from apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientSpringWeb.java rename to apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWeb.java index 376254d9..03b173a3 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientSpringWeb.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWeb.java @@ -1,12 +1,15 @@ -package smecalculus.bezmen.messaging; +package smecalculus.bezmen.interior.messaging; import lombok.NonNull; import org.springframework.http.MediaType; import org.springframework.test.web.reactive.server.WebTestClient; -import smecalculus.bezmen.messaging.client.SepulkaClient; -import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; -import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaClient; +import smecalculus.bezmen.exterior.messaging.SepulkaMsgMapper; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisterSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSliceMsg; +// TODO: подумать о том, чтобы перенести в testing, в messaging или в abstraction (prod or test jar) public record SepulkaClientSpringWeb(@NonNull WebTestClient client, @NonNull SepulkaMsgMapper mapper) implements SepulkaClient { diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientSpringWebIT.java b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWebIT.java similarity index 58% rename from apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientSpringWebIT.java rename to apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWebIT.java index 0859ae5b..cbe16901 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientSpringWebIT.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWebIT.java @@ -1,3 +1,3 @@ -package smecalculus.bezmen.messaging; +package smecalculus.bezmen.interior.messaging; public class SepulkaClientSpringWebIT extends SepulkaClientIT {} diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoIT.java b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoIT.java similarity index 81% rename from apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoIT.java rename to apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoIT.java index 607d1cda..ad5f227e 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoIT.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoIT.java @@ -1,7 +1,7 @@ -package smecalculus.bezmen.storage; +package smecalculus.bezmen.interior.storage; import static org.assertj.core.api.Assertions.assertThat; -import static smecalculus.bezmen.core.SepulkaEg.Pojos.sepulka; +import static smecalculus.bezmen.interior.core.SepulkaEg.Pojos.sepulka; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -9,8 +9,8 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.jdbc.Sql; import org.springframework.test.context.junit.jupiter.SpringExtension; -import smecalculus.bezmen.construction.SepulkaDaoBeans; -import smecalculus.bezmen.core.Sepulka; +import smecalculus.bezmen.interior.construction.SepulkaDaoBeans; +import smecalculus.bezmen.interior.core.Sepulka; @ExtendWith(SpringExtension.class) @ContextConfiguration(classes = SepulkaDaoBeans.class) diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoMyBatisPostgresIT.java b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoMyBatisPostgresIT.java similarity index 56% rename from apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoMyBatisPostgresIT.java rename to apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoMyBatisPostgresIT.java index 31aac61e..9c37e9a2 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoMyBatisPostgresIT.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoMyBatisPostgresIT.java @@ -1,8 +1,8 @@ -package smecalculus.bezmen.storage; +package smecalculus.bezmen.interior.storage; import org.springframework.test.context.ContextConfiguration; -import smecalculus.bezmen.construction.MappingMyBatisBeans; -import smecalculus.bezmen.construction.SepulkaDaoBeans; +import smecalculus.bezmen.interior.construction.MappingMyBatisBeans; +import smecalculus.bezmen.interior.construction.SepulkaDaoBeans; @ContextConfiguration(classes = {SepulkaDaoBeans.MyBatisPostgres.class, MappingMyBatisBeans.class}) public class SepulkaDaoMyBatisPostgresIT extends SepulkaDaoIT {} diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoMyBatisTest.java b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoMyBatisTest.java similarity index 68% rename from apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoMyBatisTest.java rename to apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoMyBatisTest.java index 3536c60f..81707ecf 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoMyBatisTest.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoMyBatisTest.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.storage; +package smecalculus.bezmen.interior.storage; import org.junit.jupiter.api.Test; diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoSpringDataPostgresIT.java b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoSpringDataPostgresIT.java similarity index 56% rename from apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoSpringDataPostgresIT.java rename to apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoSpringDataPostgresIT.java index 386a603a..df0668f1 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoSpringDataPostgresIT.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/storage/SepulkaDaoSpringDataPostgresIT.java @@ -1,8 +1,8 @@ -package smecalculus.bezmen.storage; +package smecalculus.bezmen.interior.storage; import org.springframework.test.context.ContextConfiguration; -import smecalculus.bezmen.construction.MappingSpringDataBeans; -import smecalculus.bezmen.construction.SepulkaDaoBeans; +import smecalculus.bezmen.interior.construction.MappingSpringDataBeans; +import smecalculus.bezmen.interior.construction.SepulkaDaoBeans; @ContextConfiguration(classes = {SepulkaDaoBeans.SpringDataPostgres.class, MappingSpringDataBeans.class}) public class SepulkaDaoSpringDataPostgresIT extends SepulkaDaoIT {} diff --git a/libs/abstraction/pom.xml b/libs/abstraction/pom.xml index 2903da8f..91a0c6a9 100644 --- a/libs/abstraction/pom.xml +++ b/libs/abstraction/pom.xml @@ -28,19 +28,12 @@ org.apache.maven.plugins maven-jar-plugin - 3.3.0 - client + client-jar jar - - client - - **/messaging/client/** - - diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/BezmenClient.java b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/BezmenClient.java similarity index 54% rename from libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/BezmenClient.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/BezmenClient.java index 62983b86..2d9d4965 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/BezmenClient.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/BezmenClient.java @@ -1,3 +1,3 @@ -package smecalculus.bezmen.messaging.client; +package smecalculus.bezmen.exterior.messaging; public interface BezmenClient extends SepulingClient {} diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulingClient.java b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulingClient.java similarity index 61% rename from libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulingClient.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulingClient.java index 27624ee8..aeae9568 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulingClient.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulingClient.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.messaging.client; +package smecalculus.bezmen.exterior.messaging; interface SepulingClient extends SepulkaClient { boolean isReady(); diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaClient.java b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaClient.java similarity index 68% rename from libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaClient.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaClient.java index 6fe16585..d9af5993 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaClient.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaClient.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.messaging.client; +package smecalculus.bezmen.exterior.messaging; public interface SepulkaClient { SepulkaRegisteredSlice register(SepulkaRegisterSlice command); diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaMsgMapper.java b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaMsgMapper.java similarity index 67% rename from apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaMsgMapper.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaMsgMapper.java index e8a3f9d5..5785b301 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaMsgMapper.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaMsgMapper.java @@ -1,8 +1,6 @@ -package smecalculus.bezmen.messaging; +package smecalculus.bezmen.exterior.messaging; import org.mapstruct.Mapper; -import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; -import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; @Mapper public interface SepulkaMsgMapper { diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSlice.java b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisterSlice.java similarity index 64% rename from libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSlice.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisterSlice.java index 0a6ff4cf..57fa7db6 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSlice.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisterSlice.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.messaging.client; +package smecalculus.bezmen.exterior.messaging; import lombok.NonNull; diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSliceEg.java b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisterSliceEg.java similarity index 84% rename from libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSliceEg.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisterSliceEg.java index 8ece390a..ea5ec87b 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisterSliceEg.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisterSliceEg.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.messaging.client; +package smecalculus.bezmen.exterior.messaging; public class SepulkaRegisterSliceEg { public static final String NAME = "foo"; diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisterSliceMsg.java b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisterSliceMsg.java similarity index 66% rename from apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisterSliceMsg.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisterSliceMsg.java index e8761755..dea4ba85 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisterSliceMsg.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisterSliceMsg.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.messaging; +package smecalculus.bezmen.exterior.messaging; import lombok.Data; diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSlice.java b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisteredSlice.java similarity index 69% rename from libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSlice.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisteredSlice.java index 46f012f9..d781bb13 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSlice.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisteredSlice.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.messaging.client; +package smecalculus.bezmen.exterior.messaging; import java.util.UUID; import lombok.NonNull; diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSliceEg.java b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisteredSliceEg.java similarity index 89% rename from libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSliceEg.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisteredSliceEg.java index 800c753e..a741c9da 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/messaging/client/SepulkaRegisteredSliceEg.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisteredSliceEg.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.messaging.client; +package smecalculus.bezmen.exterior.messaging; import java.util.UUID; diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisteredSliceMsg.java b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisteredSliceMsg.java similarity index 66% rename from apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisteredSliceMsg.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisteredSliceMsg.java index 7d38455c..a67e2ded 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaRegisteredSliceMsg.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaRegisteredSliceMsg.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.messaging; +package smecalculus.bezmen.exterior.messaging; import lombok.Data; diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/configuration/ConfigKeeper.java b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/configuration/ConfigKeeper.java similarity index 60% rename from libs/abstraction/src/main/java/smecalculus/bezmen/configuration/ConfigKeeper.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/interior/configuration/ConfigKeeper.java index cdb202e1..5685767f 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/configuration/ConfigKeeper.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/configuration/ConfigKeeper.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; public interface ConfigKeeper { T read(String key, Class type); diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/Sepulka.java b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/Sepulka.java similarity index 77% rename from libs/abstraction/src/main/java/smecalculus/bezmen/core/Sepulka.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/Sepulka.java index c292edc3..5ec9e640 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/Sepulka.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/Sepulka.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.core; +package smecalculus.bezmen.interior.core; import java.util.UUID; import lombok.Builder; diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaEg.java b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/SepulkaEg.java similarity index 93% rename from libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaEg.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/SepulkaEg.java index ae853ae8..694e30b1 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaEg.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/SepulkaEg.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.core; +package smecalculus.bezmen.interior.core; import java.util.UUID; diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaService.java b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/SepulkaService.java similarity index 57% rename from libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaService.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/SepulkaService.java index fd2ede5b..4b0c3eea 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaService.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/SepulkaService.java @@ -1,7 +1,7 @@ -package smecalculus.bezmen.core; +package smecalculus.bezmen.interior.core; import java.util.List; -import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisterSlice; public interface SepulkaService { Sepulka register(SepulkaRegisterSlice slice); diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaSliceMapper.java b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/SepulkaSliceMapper.java similarity index 54% rename from libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaSliceMapper.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/SepulkaSliceMapper.java index fd2c50f2..d23f6e89 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaSliceMapper.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/core/SepulkaSliceMapper.java @@ -1,7 +1,7 @@ -package smecalculus.bezmen.core; +package smecalculus.bezmen.interior.core; import org.mapstruct.Mapper; -import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSlice; @Mapper public interface SepulkaSliceMapper { diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/validation/EdgeValidator.java b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/validation/EdgeValidator.java similarity index 64% rename from libs/abstraction/src/main/java/smecalculus/bezmen/validation/EdgeValidator.java rename to libs/abstraction/src/main/java/smecalculus/bezmen/interior/validation/EdgeValidator.java index eff4e408..97d3c45c 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/validation/EdgeValidator.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/interior/validation/EdgeValidator.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.validation; +package smecalculus.bezmen.interior.validation; public interface EdgeValidator { void validate(T object, Class... groups); diff --git a/libs/essentials/pom.xml b/libs/essentials/pom.xml index 0a4baa43..e3c2121e 100644 --- a/libs/essentials/pom.xml +++ b/libs/essentials/pom.xml @@ -13,15 +13,11 @@ essentials - + ${project.groupId} abstraction - - org.jetbrains.kotlin - kotlin-stdlib - org.hibernate.validator @@ -51,11 +47,6 @@ ch.qos.logback logback-classic - - - org.mapstruct - mapstruct - org.springframework @@ -65,9 +56,5 @@ org.springframework.boot spring-boot - - org.jetbrains.kotlin - kotlin-reflect - diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ConfigBeans.java b/libs/essentials/src/main/java/smecalculus/bezmen/construction/ConfigBeans.java deleted file mode 100644 index 85c837b9..00000000 --- a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ConfigBeans.java +++ /dev/null @@ -1,31 +0,0 @@ -package smecalculus.bezmen.construction; - -import static smecalculus.bezmen.configuration.ConfigMappingMode.LIGHTBEND_CONFIG; -import static smecalculus.bezmen.configuration.ConfigMappingMode.SPRING_CONFIG; -import static smecalculus.bezmen.configuration.ConfigProtocolMode.FILE_SYSTEM; - -import com.typesafe.config.ConfigFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.env.Environment; -import smecalculus.bezmen.configuration.ConfigKeeper; -import smecalculus.bezmen.configuration.ConfigKeeperLightbendConfig; -import smecalculus.bezmen.configuration.ConfigKeeperSpringConfig; - -@Configuration(proxyBeanMethods = false) -public class ConfigBeans { - - @Bean - @ConditionalOnConfigProtocolMode(FILE_SYSTEM) - @ConditionalOnConfigMappingMode(LIGHTBEND_CONFIG) - ConfigKeeper configKeeperLightbendConfig() { - return new ConfigKeeperLightbendConfig(ConfigFactory.load()); - } - - @Bean - @ConditionalOnConfigProtocolMode(FILE_SYSTEM) - @ConditionalOnConfigMappingMode(SPRING_CONFIG) - ConfigKeeper configKeeperSpringConfig(Environment environment) { - return new ConfigKeeperSpringConfig(environment); - } -} diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigKeeperLightbendConfig.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigKeeperLightbendConfig.java similarity index 85% rename from libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigKeeperLightbendConfig.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigKeeperLightbendConfig.java index 7f90d7f2..c0acde9d 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigKeeperLightbendConfig.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigKeeperLightbendConfig.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import com.typesafe.config.Config; import com.typesafe.config.ConfigBeanFactory; diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigKeeperSpringConfig.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigKeeperSpringConfig.java similarity index 87% rename from libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigKeeperSpringConfig.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigKeeperSpringConfig.java index 7ec0f62b..fbdaf8f5 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigKeeperSpringConfig.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigKeeperSpringConfig.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.core.env.Environment; diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigMappingMode.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigMappingMode.java similarity index 59% rename from libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigMappingMode.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigMappingMode.java index 6b93eca4..99712b9c 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigMappingMode.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigMappingMode.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; public enum ConfigMappingMode { LIGHTBEND_CONFIG, diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigProtocolMode.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigProtocolMode.java similarity index 50% rename from libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigProtocolMode.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigProtocolMode.java index 086768aa..a1acfbee 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/configuration/ConfigProtocolMode.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/configuration/ConfigProtocolMode.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; public enum ConfigProtocolMode { FILE_SYSTEM diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ConditionalOnConfigMappingMode.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnConfigMappingMode.java similarity index 78% rename from libs/essentials/src/main/java/smecalculus/bezmen/construction/ConditionalOnConfigMappingMode.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnConfigMappingMode.java index d92a2be1..42d49162 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ConditionalOnConfigMappingMode.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnConfigMappingMode.java @@ -1,11 +1,11 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.context.annotation.Conditional; -import smecalculus.bezmen.configuration.ConfigMappingMode; +import smecalculus.bezmen.interior.configuration.ConfigMappingMode; @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ConditionalOnConfigProtocolMode.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnConfigProtocolMode.java similarity index 78% rename from libs/essentials/src/main/java/smecalculus/bezmen/construction/ConditionalOnConfigProtocolMode.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnConfigProtocolMode.java index ef188f0a..2e414d90 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ConditionalOnConfigProtocolMode.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnConfigProtocolMode.java @@ -1,11 +1,11 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.context.annotation.Conditional; -import smecalculus.bezmen.configuration.ConfigProtocolMode; +import smecalculus.bezmen.interior.configuration.ConfigProtocolMode; @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConfigBeans.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConfigBeans.java new file mode 100644 index 00000000..f0cbd216 --- /dev/null +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConfigBeans.java @@ -0,0 +1,29 @@ +package smecalculus.bezmen.interior.construction; + +import com.typesafe.config.ConfigFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; +import smecalculus.bezmen.interior.configuration.ConfigKeeper; +import smecalculus.bezmen.interior.configuration.ConfigKeeperLightbendConfig; +import smecalculus.bezmen.interior.configuration.ConfigKeeperSpringConfig; +import smecalculus.bezmen.interior.configuration.ConfigMappingMode; +import smecalculus.bezmen.interior.configuration.ConfigProtocolMode; + +@Configuration(proxyBeanMethods = false) +public class ConfigBeans { + + @Bean + @ConditionalOnConfigProtocolMode(ConfigProtocolMode.FILE_SYSTEM) + @ConditionalOnConfigMappingMode(ConfigMappingMode.LIGHTBEND_CONFIG) + ConfigKeeper configKeeperLightbendConfig() { + return new ConfigKeeperLightbendConfig(ConfigFactory.load()); + } + + @Bean + @ConditionalOnConfigProtocolMode(ConfigProtocolMode.FILE_SYSTEM) + @ConditionalOnConfigMappingMode(ConfigMappingMode.SPRING_CONFIG) + ConfigKeeper configKeeperSpringConfig(Environment environment) { + return new ConfigKeeperSpringConfig(environment); + } +} diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ConfigMappingModeCondition.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConfigMappingModeCondition.java similarity index 89% rename from libs/essentials/src/main/java/smecalculus/bezmen/construction/ConfigMappingModeCondition.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConfigMappingModeCondition.java index a205f333..486b77bd 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ConfigMappingModeCondition.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConfigMappingModeCondition.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import static org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase.REGISTER_BEAN; @@ -6,7 +6,7 @@ import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.ConfigurationCondition; import org.springframework.core.type.AnnotatedTypeMetadata; -import smecalculus.bezmen.configuration.ConfigMappingMode; +import smecalculus.bezmen.interior.configuration.ConfigMappingMode; class ConfigMappingModeCondition implements ConfigurationCondition { diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ConfigProtocolModeCondition.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConfigProtocolModeCondition.java similarity index 89% rename from libs/essentials/src/main/java/smecalculus/bezmen/construction/ConfigProtocolModeCondition.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConfigProtocolModeCondition.java index 0d8f0a8a..6d44dc83 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ConfigProtocolModeCondition.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ConfigProtocolModeCondition.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import static org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase.REGISTER_BEAN; @@ -6,7 +6,7 @@ import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.ConfigurationCondition; import org.springframework.core.type.AnnotatedTypeMetadata; -import smecalculus.bezmen.configuration.ConfigProtocolMode; +import smecalculus.bezmen.interior.configuration.ConfigProtocolMode; class ConfigProtocolModeCondition implements ConfigurationCondition { diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ValidationBeans.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ValidationBeans.java similarity index 64% rename from libs/essentials/src/main/java/smecalculus/bezmen/construction/ValidationBeans.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ValidationBeans.java index 34631c1f..cda8fdee 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/construction/ValidationBeans.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/construction/ValidationBeans.java @@ -1,17 +1,17 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import jakarta.validation.Validation; import jakarta.validation.ValidatorFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import smecalculus.bezmen.validation.EdgeValidator; -import smecalculus.bezmen.validation.EdgeValidatorHibernateValidator; +import smecalculus.bezmen.interior.validation.EdgeValidator; +import smecalculus.bezmen.interior.validation.EdgeValidatorHibernateValidator; @Configuration(proxyBeanMethods = false) public class ValidationBeans { @Bean - EdgeValidator validator() { + EdgeValidator edgeValidatorHibernateValidator() { ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); return new EdgeValidatorHibernateValidator(factory.getValidator()); } diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/validation/EdgeValidatorHibernateValidator.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/validation/EdgeValidatorHibernateValidator.java similarity index 92% rename from libs/essentials/src/main/java/smecalculus/bezmen/validation/EdgeValidatorHibernateValidator.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/validation/EdgeValidatorHibernateValidator.java index ff4b5576..94ff26ac 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/validation/EdgeValidatorHibernateValidator.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/validation/EdgeValidatorHibernateValidator.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.validation; +package smecalculus.bezmen.interior.validation; import jakarta.validation.ConstraintViolation; import jakarta.validation.ConstraintViolationException; diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/validation/ValueOfEnum.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/validation/ValueOfEnum.java similarity index 93% rename from libs/essentials/src/main/java/smecalculus/bezmen/validation/ValueOfEnum.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/validation/ValueOfEnum.java index b9d0a614..53d870b6 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/validation/ValueOfEnum.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/validation/ValueOfEnum.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.validation; +package smecalculus.bezmen.interior.validation; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.TYPE_USE; diff --git a/libs/essentials/src/main/java/smecalculus/bezmen/validation/ValueOfEnumValidator.java b/libs/essentials/src/main/java/smecalculus/bezmen/interior/validation/ValueOfEnumValidator.java similarity index 95% rename from libs/essentials/src/main/java/smecalculus/bezmen/validation/ValueOfEnumValidator.java rename to libs/essentials/src/main/java/smecalculus/bezmen/interior/validation/ValueOfEnumValidator.java index bff80fd6..6f765595 100644 --- a/libs/essentials/src/main/java/smecalculus/bezmen/validation/ValueOfEnumValidator.java +++ b/libs/essentials/src/main/java/smecalculus/bezmen/interior/validation/ValueOfEnumValidator.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.validation; +package smecalculus.bezmen.interior.validation; import static java.lang.String.format; import static java.util.stream.Collectors.toSet; diff --git a/libs/essentials/src/main/kotlin/smecalculus/bezmen/modeling/Sepulcarium.kt b/libs/essentials/src/main/kotlin/smecalculus/bezmen/modeling/Sepulcarium.kt deleted file mode 100644 index 62f2aaa0..00000000 --- a/libs/essentials/src/main/kotlin/smecalculus/bezmen/modeling/Sepulcarium.kt +++ /dev/null @@ -1,3 +0,0 @@ -package smecalculus.bezmen.modeling - -class Sepulcarium diff --git a/libs/messaging/pom.xml b/libs/messaging/pom.xml index 95b3c924..88b7b821 100644 --- a/libs/messaging/pom.xml +++ b/libs/messaging/pom.xml @@ -76,19 +76,12 @@ org.apache.maven.plugins maven-jar-plugin - 3.3.0 - client + client-jar jar - - client - - **/messaging/client/** - - diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebMvcBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebMvcBeans.java deleted file mode 100644 index 208c1df5..00000000 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebMvcBeans.java +++ /dev/null @@ -1,13 +0,0 @@ -package smecalculus.bezmen.construction; - -import static smecalculus.bezmen.configuration.MessageMappingMode.SPRING_MVC; -import static smecalculus.bezmen.configuration.MessagingProtocolMode.HTTP; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; - -@ConditionalOnMessagingProtocolModes(HTTP) -@ConditionalOnMessageMappingModes(SPRING_MVC) -@EnableWebMvc -@Configuration(proxyBeanMethods = false) -public class MappingSpringWebMvcBeans {} diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/messaging/client/BezmenClientJavaHttp.java b/libs/messaging/src/main/java/smecalculus/bezmen/exterior/messaging/BezmenClientJavaHttp.java similarity index 67% rename from libs/messaging/src/main/java/smecalculus/bezmen/messaging/client/BezmenClientJavaHttp.java rename to libs/messaging/src/main/java/smecalculus/bezmen/exterior/messaging/BezmenClientJavaHttp.java index 4503252d..2b6cd0f5 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/messaging/client/BezmenClientJavaHttp.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/exterior/messaging/BezmenClientJavaHttp.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.messaging.client; +package smecalculus.bezmen.exterior.messaging; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -9,21 +9,27 @@ import java.net.http.HttpRequest.BodyPublishers; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; +import lombok.NonNull; -public record BezmenClientJavaHttp(ObjectMapper mapper, HttpClient client) implements BezmenClient { +public record BezmenClientJavaHttp( + @NonNull SepulkaMsgMapper msgMapper, @NonNull ObjectMapper jsonMapper, @NonNull HttpClient client) + implements BezmenClient { @Override - public SepulkaRegisteredSlice register(SepulkaRegisterSlice command) { + public SepulkaRegisteredSlice register(SepulkaRegisterSlice request) { try { - String jsonRequest = mapper.writeValueAsString(command); + SepulkaRegisterSliceMsg requestMsg = msgMapper.toMsg(request); + String requestJson = jsonMapper.writeValueAsString(requestMsg); HttpRequest httpRequest = HttpRequest.newBuilder() .uri(URI.create("http://localhost:8080/sepulkas")) - .POST(BodyPublishers.ofString(jsonRequest)) + .POST(BodyPublishers.ofString(requestJson)) .header("Content-Type", "application/json") .header("Accept", "application/json") .build(); - HttpResponse httpResponse = client.send(httpRequest, BodyHandlers.ofString()); - return mapper.readValue(httpResponse.body(), SepulkaRegisteredSlice.class); + HttpResponse responseHttp = client.send(httpRequest, BodyHandlers.ofString()); + SepulkaRegisteredSliceMsg responseMsg = + jsonMapper.readValue(responseHttp.body(), SepulkaRegisteredSliceMsg.class); + return msgMapper.toDomain(responseMsg); } catch (JsonProcessingException e) { throw new RuntimeException(e); } catch (IOException | InterruptedException e) { diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingMode.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingMode.java similarity index 59% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingMode.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingMode.java index 4adfba89..9e66c6b2 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingMode.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingMode.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; public enum MessageMappingMode { SPRING_MVC, diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingProps.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingProps.java similarity index 76% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingProps.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingProps.java index 70d91764..fd338bf7 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingProps.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingProps.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import java.util.Set; import lombok.Builder; diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsCfg.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingPropsCfg.java similarity index 71% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsCfg.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingPropsCfg.java index b2045650..856c4b17 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsCfg.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingPropsCfg.java @@ -1,10 +1,10 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; import java.util.Set; import lombok.Data; -import smecalculus.bezmen.validation.ValueOfEnum; +import smecalculus.bezmen.interior.validation.ValueOfEnum; @Data public class MessageMappingPropsCfg { diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsEg.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingPropsEg.java similarity index 64% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsEg.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingPropsEg.java index 2827d7a0..9c91b0bd 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsEg.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessageMappingPropsEg.java @@ -1,13 +1,11 @@ -package smecalculus.bezmen.configuration; - -import static smecalculus.bezmen.configuration.MessageMappingMode.SPRING_MVC; +package smecalculus.bezmen.interior.configuration; import java.util.Set; public class MessageMappingPropsEg { public static class Builders { public static MessageMappingProps.Builder messageMappingProps() { - return MessageMappingProps.builder().mappingModes(Set.of(SPRING_MVC)); + return MessageMappingProps.builder().mappingModes(Set.of(MessageMappingMode.SPRING_MVC)); } } } diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingCfgMapper.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingCfgMapper.java similarity index 94% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingCfgMapper.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingCfgMapper.java index 2cd35b05..ae2b526a 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingCfgMapper.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingCfgMapper.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import org.mapstruct.Mapper; import org.mapstruct.Mapping; diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProps.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProps.java similarity index 78% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProps.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProps.java index 37f710b9..8ed8dac0 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProps.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProps.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import lombok.Builder; import lombok.NonNull; diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsCfg.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingPropsCfg.java similarity index 80% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsCfg.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingPropsCfg.java index 917e19c3..96f9f77a 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsCfg.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingPropsCfg.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import jakarta.validation.constraints.NotNull; import lombok.Data; diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsEg.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingPropsEg.java similarity index 54% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsEg.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingPropsEg.java index 44e0ef20..af301bac 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsEg.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingPropsEg.java @@ -1,7 +1,7 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; -import static smecalculus.bezmen.configuration.MessageMappingPropsEg.Builders.messageMappingProps; -import static smecalculus.bezmen.configuration.MessagingProtocolPropsEg.Builders.messagingProtocolProps; +import static smecalculus.bezmen.interior.configuration.MessageMappingPropsEg.Builders.messageMappingProps; +import static smecalculus.bezmen.interior.configuration.MessagingProtocolPropsEg.Builders.messagingProtocolProps; public class MessagingPropsEg { public static class Builders { diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolMode.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolMode.java similarity index 52% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolMode.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolMode.java index 81021b0c..bd7ea7c4 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolMode.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolMode.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; public enum MessagingProtocolMode { HTTP, diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolProps.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolProps.java similarity index 76% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolProps.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolProps.java index 7df3ce65..d99a89e9 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolProps.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolProps.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import java.util.Set; import lombok.Builder; diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsCfg.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolPropsCfg.java similarity index 71% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsCfg.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolPropsCfg.java index 522501b3..b8721650 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsCfg.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolPropsCfg.java @@ -1,10 +1,10 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; import java.util.Set; import lombok.Data; -import smecalculus.bezmen.validation.ValueOfEnum; +import smecalculus.bezmen.interior.validation.ValueOfEnum; @Data public class MessagingProtocolPropsCfg { diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsEg.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolPropsEg.java similarity index 67% rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsEg.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolPropsEg.java index 13829818..f120e02f 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsEg.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/configuration/MessagingProtocolPropsEg.java @@ -1,6 +1,6 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; -import static smecalculus.bezmen.configuration.MessagingProtocolMode.HTTP; +import static smecalculus.bezmen.interior.configuration.MessagingProtocolMode.HTTP; import java.util.Set; diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/ConditionalOnMessageMappingModes.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnMessageMappingModes.java similarity index 78% rename from libs/messaging/src/main/java/smecalculus/bezmen/construction/ConditionalOnMessageMappingModes.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnMessageMappingModes.java index 64cea4dc..abb8dede 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/ConditionalOnMessageMappingModes.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnMessageMappingModes.java @@ -1,11 +1,11 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.context.annotation.Conditional; -import smecalculus.bezmen.configuration.MessageMappingMode; +import smecalculus.bezmen.interior.configuration.MessageMappingMode; @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/ConditionalOnMessagingProtocolModes.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnMessagingProtocolModes.java similarity index 78% rename from libs/messaging/src/main/java/smecalculus/bezmen/construction/ConditionalOnMessagingProtocolModes.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnMessagingProtocolModes.java index df59ac98..40c1a98e 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/ConditionalOnMessagingProtocolModes.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnMessagingProtocolModes.java @@ -1,11 +1,11 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.context.annotation.Conditional; -import smecalculus.bezmen.configuration.MessagingProtocolMode; +import smecalculus.bezmen.interior.configuration.MessagingProtocolMode; @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringJmxManagementBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringJmxManagementBeans.java similarity index 52% rename from libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringJmxManagementBeans.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringJmxManagementBeans.java index 22f78e70..5d982015 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringJmxManagementBeans.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringJmxManagementBeans.java @@ -1,7 +1,7 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; -import static smecalculus.bezmen.configuration.MessageMappingMode.SPRING_MANAGEMENT; -import static smecalculus.bezmen.configuration.MessagingProtocolMode.JMX; +import static smecalculus.bezmen.interior.configuration.MessageMappingMode.SPRING_MANAGEMENT; +import static smecalculus.bezmen.interior.configuration.MessagingProtocolMode.JMX; import org.springframework.context.annotation.Configuration; diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebManagementBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringWebManagementBeans.java similarity index 82% rename from libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebManagementBeans.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringWebManagementBeans.java index 1d00b0d1..ceb19839 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebManagementBeans.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringWebManagementBeans.java @@ -1,7 +1,7 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; -import static smecalculus.bezmen.configuration.MessageMappingMode.SPRING_MANAGEMENT; -import static smecalculus.bezmen.configuration.MessagingProtocolMode.HTTP; +import static smecalculus.bezmen.interior.configuration.MessageMappingMode.SPRING_MANAGEMENT; +import static smecalculus.bezmen.interior.configuration.MessagingProtocolMode.HTTP; import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration; diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringWebMvcBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringWebMvcBeans.java new file mode 100644 index 00000000..8781a0df --- /dev/null +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringWebMvcBeans.java @@ -0,0 +1,12 @@ +package smecalculus.bezmen.interior.construction; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import smecalculus.bezmen.interior.configuration.MessageMappingMode; +import smecalculus.bezmen.interior.configuration.MessagingProtocolMode; + +@ConditionalOnMessagingProtocolModes(MessagingProtocolMode.HTTP) +@ConditionalOnMessageMappingModes(MessageMappingMode.SPRING_MVC) +@EnableWebMvc +@Configuration(proxyBeanMethods = false) +public class MappingSpringWebMvcBeans {} diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessageMappingModeCondition.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessageMappingModeCondition.java similarity index 86% rename from libs/messaging/src/main/java/smecalculus/bezmen/construction/MessageMappingModeCondition.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessageMappingModeCondition.java index 0722e131..351f2735 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessageMappingModeCondition.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessageMappingModeCondition.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import static org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase.REGISTER_BEAN; @@ -8,8 +8,8 @@ import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.ConfigurationCondition; import org.springframework.core.type.AnnotatedTypeMetadata; -import smecalculus.bezmen.configuration.MessageMappingMode; -import smecalculus.bezmen.configuration.MessagingProps; +import smecalculus.bezmen.interior.configuration.MessageMappingMode; +import smecalculus.bezmen.interior.configuration.MessagingProps; class MessageMappingModeCondition implements ConfigurationCondition { diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessagingBeans.java similarity index 89% rename from libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingBeans.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessagingBeans.java index 60865bad..a47647ef 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingBeans.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessagingBeans.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingConfigBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessagingConfigBeans.java similarity index 66% rename from libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingConfigBeans.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessagingConfigBeans.java index cd190ca5..da63c8b3 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingConfigBeans.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessagingConfigBeans.java @@ -1,16 +1,16 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; -import smecalculus.bezmen.configuration.ConfigKeeper; -import smecalculus.bezmen.configuration.MessagingCfgMapper; -import smecalculus.bezmen.configuration.MessagingCfgMapperImpl; -import smecalculus.bezmen.configuration.MessagingProps; -import smecalculus.bezmen.configuration.MessagingPropsCfg; -import smecalculus.bezmen.validation.EdgeValidator; +import smecalculus.bezmen.interior.configuration.ConfigKeeper; +import smecalculus.bezmen.interior.configuration.MessagingCfgMapper; +import smecalculus.bezmen.interior.configuration.MessagingCfgMapperImpl; +import smecalculus.bezmen.interior.configuration.MessagingProps; +import smecalculus.bezmen.interior.configuration.MessagingPropsCfg; +import smecalculus.bezmen.interior.validation.EdgeValidator; @PropertySource("classpath:messaging.properties") @Configuration(proxyBeanMethods = false) diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingProtocolModeCondition.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessagingProtocolModeCondition.java similarity index 86% rename from libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingProtocolModeCondition.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessagingProtocolModeCondition.java index 29192529..6b1b2302 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingProtocolModeCondition.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/MessagingProtocolModeCondition.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import static org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase.REGISTER_BEAN; @@ -8,8 +8,8 @@ import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.ConfigurationCondition; import org.springframework.core.type.AnnotatedTypeMetadata; -import smecalculus.bezmen.configuration.MessagingProps; -import smecalculus.bezmen.configuration.MessagingProtocolMode; +import smecalculus.bezmen.interior.configuration.MessagingProps; +import smecalculus.bezmen.interior.configuration.MessagingProtocolMode; class MessagingProtocolModeCondition implements ConfigurationCondition { diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/ProtocolHttpBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ProtocolHttpBeans.java similarity index 73% rename from libs/messaging/src/main/java/smecalculus/bezmen/construction/ProtocolHttpBeans.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ProtocolHttpBeans.java index 856523ed..ae51efd0 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/ProtocolHttpBeans.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ProtocolHttpBeans.java @@ -1,13 +1,12 @@ -package smecalculus.bezmen.construction; - -import static smecalculus.bezmen.configuration.MessagingProtocolMode.HTTP; +package smecalculus.bezmen.interior.construction; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration; import org.springframework.context.annotation.Configuration; +import smecalculus.bezmen.interior.configuration.MessagingProtocolMode; -@ConditionalOnMessagingProtocolModes(HTTP) +@ConditionalOnMessagingProtocolModes(MessagingProtocolMode.HTTP) @ImportAutoConfiguration({ServletWebServerFactoryAutoConfiguration.class, DispatcherServletAutoConfiguration.class}) @Configuration(proxyBeanMethods = false) public class ProtocolHttpBeans {} diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/ProtocolJmxBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ProtocolJmxBeans.java similarity index 73% rename from libs/messaging/src/main/java/smecalculus/bezmen/construction/ProtocolJmxBeans.java rename to libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ProtocolJmxBeans.java index e3d9cb8f..c4cf2de8 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/ProtocolJmxBeans.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/interior/construction/ProtocolJmxBeans.java @@ -1,6 +1,6 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; -import static smecalculus.bezmen.configuration.MessagingProtocolMode.JMX; +import static smecalculus.bezmen.interior.configuration.MessagingProtocolMode.JMX; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration; diff --git a/libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansIT.java b/libs/messaging/src/test/java/smecalculus/bezmen/interior/construction/MessagingConfigBeansIT.java similarity index 79% rename from libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansIT.java rename to libs/messaging/src/test/java/smecalculus/bezmen/interior/construction/MessagingConfigBeansIT.java index 19dbbb29..b771b298 100644 --- a/libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansIT.java +++ b/libs/messaging/src/test/java/smecalculus/bezmen/interior/construction/MessagingConfigBeansIT.java @@ -1,14 +1,14 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import static org.assertj.core.api.Assertions.assertThat; -import static smecalculus.bezmen.configuration.MessagingPropsEg.Builders.messagingProps; +import static smecalculus.bezmen.interior.configuration.MessagingPropsEg.Builders.messagingProps; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; -import smecalculus.bezmen.configuration.MessagingProps; +import smecalculus.bezmen.interior.configuration.MessagingProps; @ExtendWith(SpringExtension.class) @ContextConfiguration(classes = {MessagingConfigBeans.class, ConfigBeans.class, ValidationBeans.class}) diff --git a/libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansLightbendConfigIT.java b/libs/messaging/src/test/java/smecalculus/bezmen/interior/construction/MessagingConfigBeansLightbendConfigIT.java similarity index 81% rename from libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansLightbendConfigIT.java rename to libs/messaging/src/test/java/smecalculus/bezmen/interior/construction/MessagingConfigBeansLightbendConfigIT.java index 5e8b69f1..24ffe9d4 100644 --- a/libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansLightbendConfigIT.java +++ b/libs/messaging/src/test/java/smecalculus/bezmen/interior/construction/MessagingConfigBeansLightbendConfigIT.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import org.springframework.test.context.TestPropertySource; diff --git a/libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansSpringConfigIT.java b/libs/messaging/src/test/java/smecalculus/bezmen/interior/construction/MessagingConfigBeansSpringConfigIT.java similarity index 81% rename from libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansSpringConfigIT.java rename to libs/messaging/src/test/java/smecalculus/bezmen/interior/construction/MessagingConfigBeansSpringConfigIT.java index 668b3e3f..36b53175 100644 --- a/libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansSpringConfigIT.java +++ b/libs/messaging/src/test/java/smecalculus/bezmen/interior/construction/MessagingConfigBeansSpringConfigIT.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import org.springframework.test.context.TestPropertySource; diff --git a/libs/pom.xml b/libs/pom.xml index 09ac00df..c6f2e883 100644 --- a/libs/pom.xml +++ b/libs/pom.xml @@ -20,7 +20,6 @@ 0.1.0-SNAPSHOT - 1.9.10 1.18.30 1.5.5.Final 6.0.12 @@ -32,6 +31,7 @@ false ${skipTests} true + false UTF-8 @@ -95,18 +95,6 @@ ${project.version} - - org.jetbrains.kotlin - kotlin-reflect - ${kotlin.version} - runtime - - - org.jetbrains.kotlin - kotlin-stdlib - ${kotlin.version} - - org.projectlombok lombok @@ -337,24 +325,6 @@ org.jacoco jacoco-maven-plugin - - org.jetbrains.kotlin - kotlin-maven-plugin - - - compile - - compile - - - - test-compile - - test-compile - - - - @@ -363,10 +333,8 @@ org.apache.maven.plugins maven-compiler-plugin 3.11.0 - - 17 - 17 + 17 UTF-8 @@ -383,9 +351,20 @@ - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + client-jar + + client + + **/exterior/** + + + + org.apache.maven.plugins diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/H2Props.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/H2Props.java similarity index 79% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/H2Props.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/H2Props.java index a16d6945..f5febf82 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/H2Props.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/H2Props.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import lombok.Builder; import lombok.NonNull; diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/H2PropsCfg.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/H2PropsCfg.java similarity index 80% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/H2PropsCfg.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/H2PropsCfg.java index f7eaf189..3c5226c6 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/H2PropsCfg.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/H2PropsCfg.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import jakarta.validation.constraints.NotBlank; import lombok.Data; diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/PostgresProps.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/PostgresProps.java similarity index 80% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/PostgresProps.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/PostgresProps.java index b80f1901..c2c734c6 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/PostgresProps.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/PostgresProps.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import lombok.Builder; import lombok.NonNull; diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/PostgresPropsCfg.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/PostgresPropsCfg.java similarity index 83% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/PostgresPropsCfg.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/PostgresPropsCfg.java index d0839893..880d99ea 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/PostgresPropsCfg.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/PostgresPropsCfg.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import jakarta.validation.constraints.NotBlank; import lombok.Data; diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingMode.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingMode.java similarity index 55% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingMode.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingMode.java index 40335f1a..afbd1bd2 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingMode.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingMode.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; public enum StateMappingMode { SPRING_DATA, diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingProps.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingProps.java similarity index 66% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingProps.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingProps.java index f8010d0c..2034f72b 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingProps.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingProps.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import lombok.Builder; diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingPropsCfg.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingPropsCfg.java similarity index 54% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingPropsCfg.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingPropsCfg.java index dfd890f0..692aa719 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingPropsCfg.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingPropsCfg.java @@ -1,7 +1,7 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import lombok.Data; -import smecalculus.bezmen.validation.ValueOfEnum; +import smecalculus.bezmen.interior.validation.ValueOfEnum; @Data public class StateMappingPropsCfg { diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingPropsEg.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingPropsEg.java similarity index 78% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingPropsEg.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingPropsEg.java index c7bb4c25..db6ce4ce 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingPropsEg.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StateMappingPropsEg.java @@ -1,6 +1,6 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; -import static smecalculus.bezmen.configuration.StateMappingMode.SPRING_DATA; +import static smecalculus.bezmen.interior.configuration.StateMappingMode.SPRING_DATA; public class StateMappingPropsEg { public static class Pojos { diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageCfgMapper.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageCfgMapper.java similarity index 94% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageCfgMapper.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageCfgMapper.java index 02ca7a8b..a1a5937b 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageCfgMapper.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageCfgMapper.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import org.mapstruct.Mapper; import org.mapstruct.Mapping; diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProps.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProps.java similarity index 77% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProps.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProps.java index d5b13b05..09abb30e 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProps.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProps.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import lombok.Builder; import lombok.NonNull; diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsCfg.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StoragePropsCfg.java similarity index 80% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsCfg.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StoragePropsCfg.java index 1e55f192..6fdbd0f7 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsCfg.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StoragePropsCfg.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import jakarta.validation.constraints.NotNull; import lombok.Data; diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsEg.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StoragePropsEg.java similarity index 58% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsEg.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StoragePropsEg.java index 9f9fe983..22564cc7 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsEg.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StoragePropsEg.java @@ -1,9 +1,9 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; -import static smecalculus.bezmen.configuration.StateMappingPropsEg.Builders.stateMappingProps; -import static smecalculus.bezmen.configuration.StateMappingPropsEg.Pojos.stateMappingPropsCfg; -import static smecalculus.bezmen.configuration.StorageProtocolPropsEg.Builders.storageProtocolProps; -import static smecalculus.bezmen.configuration.StorageProtocolPropsEg.Pojos.storageProtocolPropsCfg; +import static smecalculus.bezmen.interior.configuration.StateMappingPropsEg.Builders.stateMappingProps; +import static smecalculus.bezmen.interior.configuration.StateMappingPropsEg.Pojos.stateMappingPropsCfg; +import static smecalculus.bezmen.interior.configuration.StorageProtocolPropsEg.Builders.storageProtocolProps; +import static smecalculus.bezmen.interior.configuration.StorageProtocolPropsEg.Pojos.storageProtocolPropsCfg; public class StoragePropsEg { public static class Pojos { diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolMode.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolMode.java similarity index 53% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolMode.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolMode.java index 6c0eb350..ee79299d 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolMode.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolMode.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; public enum StorageProtocolMode { H2, diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolProps.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolProps.java similarity index 83% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolProps.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolProps.java index 81c566fc..8fbcfeed 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolProps.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolProps.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import lombok.Builder; import lombok.NonNull; diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolPropsCfg.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolPropsCfg.java similarity index 69% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolPropsCfg.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolPropsCfg.java index 82a23b70..045d740c 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolPropsCfg.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolPropsCfg.java @@ -1,8 +1,8 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; import com.typesafe.config.Optional; import lombok.Data; -import smecalculus.bezmen.validation.ValueOfEnum; +import smecalculus.bezmen.interior.validation.ValueOfEnum; @Data public class StorageProtocolPropsCfg { diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolPropsEg.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolPropsEg.java similarity index 95% rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolPropsEg.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolPropsEg.java index e4e89b39..2cc9eb5b 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageProtocolPropsEg.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolPropsEg.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.configuration; +package smecalculus.bezmen.interior.configuration; public class StorageProtocolPropsEg { public static class Pojos { diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/ConditionalOnStateMappingMode.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnStateMappingMode.java similarity index 78% rename from libs/storage/src/main/java/smecalculus/bezmen/construction/ConditionalOnStateMappingMode.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnStateMappingMode.java index 3b1eb03c..e5739d8c 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/construction/ConditionalOnStateMappingMode.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/ConditionalOnStateMappingMode.java @@ -1,11 +1,11 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.context.annotation.Conditional; -import smecalculus.bezmen.configuration.StateMappingMode; +import smecalculus.bezmen.interior.configuration.StateMappingMode; @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingMyBatisBeans.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingMyBatisBeans.java similarity index 84% rename from libs/storage/src/main/java/smecalculus/bezmen/construction/MappingMyBatisBeans.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingMyBatisBeans.java index 8339f75c..dc9e5ad9 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingMyBatisBeans.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingMyBatisBeans.java @@ -1,6 +1,6 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; -import static smecalculus.bezmen.configuration.StateMappingMode.MY_BATIS; +import static smecalculus.bezmen.interior.configuration.StateMappingMode.MY_BATIS; import javax.sql.DataSource; import org.apache.ibatis.session.SqlSessionFactory; diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingSpringDataBeans.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringDataBeans.java similarity index 81% rename from libs/storage/src/main/java/smecalculus/bezmen/construction/MappingSpringDataBeans.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringDataBeans.java index 927dfc67..e2067624 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingSpringDataBeans.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringDataBeans.java @@ -1,6 +1,6 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; -import static smecalculus.bezmen.configuration.StateMappingMode.SPRING_DATA; +import static smecalculus.bezmen.interior.configuration.StateMappingMode.SPRING_DATA; import javax.sql.DataSource; import org.springframework.context.annotation.Bean; @@ -13,12 +13,12 @@ import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.transaction.PlatformTransactionManager; -import smecalculus.bezmen.configuration.StorageProps; -import smecalculus.bezmen.configuration.StorageProtocolProps; +import smecalculus.bezmen.interior.configuration.StorageProps; +import smecalculus.bezmen.interior.configuration.StorageProtocolProps; @Configuration(proxyBeanMethods = false) @ConditionalOnStateMappingMode(SPRING_DATA) -@EnableJdbcRepositories("smecalculus.bezmen.storage.springdata") +@EnableJdbcRepositories("smecalculus.bezmen.interior.storage.springdata") public class MappingSpringDataBeans extends AbstractJdbcConfiguration { @Bean diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/StateMappingModeCondition.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/StateMappingModeCondition.java similarity index 84% rename from libs/storage/src/main/java/smecalculus/bezmen/construction/StateMappingModeCondition.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/construction/StateMappingModeCondition.java index ff5dd6ba..83863e02 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/construction/StateMappingModeCondition.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/StateMappingModeCondition.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import static org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase.REGISTER_BEAN; @@ -6,8 +6,8 @@ import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.ConfigurationCondition; import org.springframework.core.type.AnnotatedTypeMetadata; -import smecalculus.bezmen.configuration.StateMappingMode; -import smecalculus.bezmen.configuration.StorageProps; +import smecalculus.bezmen.interior.configuration.StateMappingMode; +import smecalculus.bezmen.interior.configuration.StorageProps; class StateMappingModeCondition implements ConfigurationCondition { diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageBeans.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/StorageBeans.java similarity index 83% rename from libs/storage/src/main/java/smecalculus/bezmen/construction/StorageBeans.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/construction/StorageBeans.java index 2ffa68f3..8999f1b1 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageBeans.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/StorageBeans.java @@ -1,14 +1,14 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import javax.sql.DataSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.jdbc.datasource.DriverManagerDataSource; -import smecalculus.bezmen.configuration.H2Props; -import smecalculus.bezmen.configuration.PostgresProps; -import smecalculus.bezmen.configuration.StorageProps; -import smecalculus.bezmen.configuration.StorageProtocolProps; +import smecalculus.bezmen.interior.configuration.H2Props; +import smecalculus.bezmen.interior.configuration.PostgresProps; +import smecalculus.bezmen.interior.configuration.StorageProps; +import smecalculus.bezmen.interior.configuration.StorageProtocolProps; @Configuration(proxyBeanMethods = false) @Import({StorageConfigBeans.class, MappingMyBatisBeans.class, MappingSpringDataBeans.class}) diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageConfigBeans.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/StorageConfigBeans.java similarity index 66% rename from libs/storage/src/main/java/smecalculus/bezmen/construction/StorageConfigBeans.java rename to libs/storage/src/main/java/smecalculus/bezmen/interior/construction/StorageConfigBeans.java index 061cf4d7..1ad72e94 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageConfigBeans.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/StorageConfigBeans.java @@ -1,16 +1,16 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; -import smecalculus.bezmen.configuration.ConfigKeeper; -import smecalculus.bezmen.configuration.StorageCfgMapper; -import smecalculus.bezmen.configuration.StorageCfgMapperImpl; -import smecalculus.bezmen.configuration.StorageProps; -import smecalculus.bezmen.configuration.StoragePropsCfg; -import smecalculus.bezmen.validation.EdgeValidator; +import smecalculus.bezmen.interior.configuration.ConfigKeeper; +import smecalculus.bezmen.interior.configuration.StorageCfgMapper; +import smecalculus.bezmen.interior.configuration.StorageCfgMapperImpl; +import smecalculus.bezmen.interior.configuration.StorageProps; +import smecalculus.bezmen.interior.configuration.StoragePropsCfg; +import smecalculus.bezmen.interior.validation.EdgeValidator; @PropertySource("classpath:storage.properties") @Configuration(proxyBeanMethods = false) diff --git a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansIT.java b/libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansIT.java similarity index 79% rename from libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansIT.java rename to libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansIT.java index 62de9f65..3c822da8 100644 --- a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansIT.java +++ b/libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansIT.java @@ -1,14 +1,14 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import static org.assertj.core.api.Assertions.assertThat; -import static smecalculus.bezmen.configuration.StoragePropsEg.Builders.storageProps; +import static smecalculus.bezmen.interior.configuration.StoragePropsEg.Builders.storageProps; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; -import smecalculus.bezmen.configuration.StorageProps; +import smecalculus.bezmen.interior.configuration.StorageProps; @ExtendWith(SpringExtension.class) @ContextConfiguration(classes = {StorageConfigBeans.class, ConfigBeans.class, ValidationBeans.class}) diff --git a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansLightbendConfigIT.java b/libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansLightbendConfigIT.java similarity index 81% rename from libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansLightbendConfigIT.java rename to libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansLightbendConfigIT.java index 4631e191..ef7e2695 100644 --- a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansLightbendConfigIT.java +++ b/libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansLightbendConfigIT.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import org.springframework.test.context.TestPropertySource; diff --git a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansSpringConfigIT.java b/libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansSpringConfigIT.java similarity index 80% rename from libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansSpringConfigIT.java rename to libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansSpringConfigIT.java index 3fe90f67..9ad3c4ad 100644 --- a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansSpringConfigIT.java +++ b/libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansSpringConfigIT.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import org.springframework.test.context.TestPropertySource; diff --git a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansTest.java b/libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansTest.java similarity index 67% rename from libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansTest.java rename to libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansTest.java index 79bf441f..559cb72e 100644 --- a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansTest.java +++ b/libs/storage/src/test/java/smecalculus/bezmen/interior/construction/StorageConfigBeansTest.java @@ -1,17 +1,17 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static smecalculus.bezmen.configuration.StoragePropsEg.Pojos.storagePropsCfg; +import static smecalculus.bezmen.interior.configuration.StoragePropsEg.Pojos.storagePropsCfg; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import smecalculus.bezmen.configuration.ConfigKeeper; -import smecalculus.bezmen.configuration.StorageCfgMapper; -import smecalculus.bezmen.configuration.StorageCfgMapperImpl; -import smecalculus.bezmen.configuration.StoragePropsCfg; -import smecalculus.bezmen.validation.EdgeValidator; +import smecalculus.bezmen.interior.configuration.ConfigKeeper; +import smecalculus.bezmen.interior.configuration.StorageCfgMapper; +import smecalculus.bezmen.interior.configuration.StorageCfgMapperImpl; +import smecalculus.bezmen.interior.configuration.StoragePropsCfg; +import smecalculus.bezmen.interior.validation.EdgeValidator; class StorageConfigBeansTest { diff --git a/libs/testing/pom.xml b/libs/testing/pom.xml index 83ce4b79..2c0e9377 100644 --- a/libs/testing/pom.xml +++ b/libs/testing/pom.xml @@ -62,10 +62,6 @@ org.assertj assertj-core - - org.springframework - spring-test - org.mockito mockito-core @@ -74,6 +70,10 @@ org.awaitility awaitility + + org.springframework + spring-test + @@ -88,6 +88,7 @@ + org.apache.maven.plugins maven-resources-plugin diff --git a/libs/testing/src/main/java/smecalculus/bezmen/construction/TestingBeans.java b/libs/testing/src/main/java/smecalculus/bezmen/interior/construction/TestingBeans.java similarity index 93% rename from libs/testing/src/main/java/smecalculus/bezmen/construction/TestingBeans.java rename to libs/testing/src/main/java/smecalculus/bezmen/interior/construction/TestingBeans.java index 435fe674..35057725 100644 --- a/libs/testing/src/main/java/smecalculus/bezmen/construction/TestingBeans.java +++ b/libs/testing/src/main/java/smecalculus/bezmen/interior/construction/TestingBeans.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.construction; +package smecalculus.bezmen.interior.construction; import static org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType.H2; diff --git a/libs/testing/src/main/java/smecalculus/bezmen/testing/ShardingExtension.java b/libs/testing/src/main/java/smecalculus/bezmen/interior/testing/ShardingExtension.java similarity index 96% rename from libs/testing/src/main/java/smecalculus/bezmen/testing/ShardingExtension.java rename to libs/testing/src/main/java/smecalculus/bezmen/interior/testing/ShardingExtension.java index 8742333b..e8551cec 100644 --- a/libs/testing/src/main/java/smecalculus/bezmen/testing/ShardingExtension.java +++ b/libs/testing/src/main/java/smecalculus/bezmen/interior/testing/ShardingExtension.java @@ -1,4 +1,4 @@ -package smecalculus.bezmen.testing; +package smecalculus.bezmen.interior.testing; import static org.junit.jupiter.api.extension.ConditionEvaluationResult.disabled; import static org.junit.jupiter.api.extension.ConditionEvaluationResult.enabled; diff --git a/libs/testing/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension b/libs/testing/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension index 747167d4..9441d8d4 100644 --- a/libs/testing/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension +++ b/libs/testing/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension @@ -1 +1 @@ -smecalculus.bezmen.testing.ShardingExtension +smecalculus.bezmen.interior.testing.ShardingExtension diff --git a/tests/e2e/src/main/java/smecalculus/bezmen/StandBeans.java b/tests/e2e/src/main/java/smecalculus/bezmen/StandBeans.java index 6e3406fa..96bf33a9 100644 --- a/tests/e2e/src/main/java/smecalculus/bezmen/StandBeans.java +++ b/tests/e2e/src/main/java/smecalculus/bezmen/StandBeans.java @@ -4,16 +4,19 @@ import java.net.http.HttpClient; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import smecalculus.bezmen.messaging.client.BezmenClient; -import smecalculus.bezmen.messaging.client.BezmenClientJavaHttp; +import smecalculus.bezmen.exterior.messaging.BezmenClient; +import smecalculus.bezmen.exterior.messaging.BezmenClientJavaHttp; +import smecalculus.bezmen.exterior.messaging.SepulkaMsgMapper; +import smecalculus.bezmen.exterior.messaging.SepulkaMsgMapperImpl; @Configuration(proxyBeanMethods = false) public class StandBeans { @Bean BezmenClient bezmenClient() { - ObjectMapper mapper = new ObjectMapper(); + SepulkaMsgMapper msgMapper = new SepulkaMsgMapperImpl(); + ObjectMapper jsonMapper = new ObjectMapper(); HttpClient client = HttpClient.newHttpClient(); - return new BezmenClientJavaHttp(mapper, client); + return new BezmenClientJavaHttp(msgMapper, jsonMapper, client); } } diff --git a/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java b/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java index c5985829..7a0c20b2 100644 --- a/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java +++ b/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java @@ -3,7 +3,7 @@ import static java.time.Duration.ofSeconds; import static org.assertj.core.api.Assertions.assertThat; import static org.awaitility.Awaitility.await; -import static smecalculus.bezmen.messaging.client.SepulkaRegisterSliceEg.Pojos.sepulkaRegisterSlice; +import static smecalculus.bezmen.exterior.messaging.SepulkaRegisterSliceEg.Pojos.sepulkaRegisterSlice; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Tag; @@ -14,10 +14,10 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; import smecalculus.bezmen.StandBeans; -import smecalculus.bezmen.messaging.client.BezmenClient; -import smecalculus.bezmen.messaging.client.SepulkaRegisterSlice; -import smecalculus.bezmen.messaging.client.SepulkaRegisteredSlice; -import smecalculus.bezmen.messaging.client.SepulkaRegisteredSliceEg; +import smecalculus.bezmen.exterior.messaging.BezmenClient; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisterSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSlice; +import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSliceEg; @ExtendWith(SpringExtension.class) @ContextConfiguration(classes = StandBeans.class) diff --git a/tests/pom.xml b/tests/pom.xml index 11dc733d..ecb529a8 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -101,8 +101,7 @@ maven-compiler-plugin 3.11.0 - 17 - 17 + 17 UTF-8 From b06682df81ad45632924a66faa5100842bb833ac Mon Sep 17 00:00:00 2001 From: Pavel Vetokhin Date: Sat, 7 Oct 2023 20:18:01 +0300 Subject: [PATCH 3/5] Skip install & deploy --- apps/lombok.config | 2 +- apps/pom.xml | 3 ++ libs/abstraction/pom.xml | 20 +++++++++---- libs/lombok.config | 2 +- libs/messaging/pom.xml | 20 +++++++++---- libs/pom.xml | 28 +++++++++++++++---- libs/storage/pom.xml | 1 + .../configuration/StorageProtocolProps.java | 3 +- pom.xml | 3 ++ tests/e2e/pom.xml | 2 ++ tests/pom.xml | 16 +++++------ tools/pom.xml | 17 +++++++++++ 12 files changed, 89 insertions(+), 28 deletions(-) diff --git a/apps/lombok.config b/apps/lombok.config index da93bc22..8a52cc50 100644 --- a/apps/lombok.config +++ b/apps/lombok.config @@ -1,2 +1,2 @@ lombok.builder.className=Builder -lombok.addLombokGeneratedAnnotation = true +lombok.addLombokGeneratedAnnotation=true diff --git a/apps/pom.xml b/apps/pom.xml index b4903d35..e751b030 100644 --- a/apps/pom.xml +++ b/apps/pom.xml @@ -96,6 +96,9 @@ ${mapstruct.version} + + -Amapstruct.unmappedTargetPolicy=IGNORE + diff --git a/libs/abstraction/pom.xml b/libs/abstraction/pom.xml index 91a0c6a9..4ee857bf 100644 --- a/libs/abstraction/pom.xml +++ b/libs/abstraction/pom.xml @@ -12,10 +12,6 @@ abstraction - - false - - jakarta.validation @@ -30,13 +26,27 @@ maven-jar-plugin - client-jar + exterior-jar jar + + org.apache.maven.plugins + maven-install-plugin + + false + + + + org.apache.maven.plugins + maven-deploy-plugin + + false + + diff --git a/libs/lombok.config b/libs/lombok.config index da93bc22..8a52cc50 100644 --- a/libs/lombok.config +++ b/libs/lombok.config @@ -1,2 +1,2 @@ lombok.builder.className=Builder -lombok.addLombokGeneratedAnnotation = true +lombok.addLombokGeneratedAnnotation=true diff --git a/libs/messaging/pom.xml b/libs/messaging/pom.xml index 88b7b821..0b1c758f 100644 --- a/libs/messaging/pom.xml +++ b/libs/messaging/pom.xml @@ -12,10 +12,6 @@ messaging - - false - - @@ -78,13 +74,27 @@ maven-jar-plugin - client-jar + exterior-jar jar + + org.apache.maven.plugins + maven-install-plugin + + false + + + + org.apache.maven.plugins + maven-deploy-plugin + + false + + diff --git a/libs/pom.xml b/libs/pom.xml index c6f2e883..ed272f70 100644 --- a/libs/pom.xml +++ b/libs/pom.xml @@ -30,8 +30,6 @@ 5.5.0 false ${skipTests} - true - false UTF-8 @@ -325,6 +323,22 @@ org.jacoco jacoco-maven-plugin + + org.apache.maven.plugins + maven-install-plugin + false + + false + + + + org.apache.maven.plugins + maven-deploy-plugin + false + + false + + @@ -335,7 +349,6 @@ 3.11.0 17 - UTF-8 org.projectlombok @@ -348,6 +361,9 @@ ${mapstruct.version} + + -Amapstruct.unmappedTargetPolicy=IGNORE + @@ -356,7 +372,7 @@ 3.3.0 - client-jar + exterior-jar client @@ -511,7 +527,7 @@ maven-install-plugin 3.1.1 - ${isPrivate} + true @@ -519,7 +535,7 @@ maven-deploy-plugin 3.1.1 - ${isPrivate} + true diff --git a/libs/storage/pom.xml b/libs/storage/pom.xml index 9bd631c7..253e240d 100644 --- a/libs/storage/pom.xml +++ b/libs/storage/pom.xml @@ -56,6 +56,7 @@ + org.apache.maven.plugins maven-failsafe-plugin diff --git a/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolProps.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolProps.java index 8fbcfeed..2b0f4b09 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolProps.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/configuration/StorageProtocolProps.java @@ -2,8 +2,7 @@ import lombok.Builder; import lombok.NonNull; -import org.springframework.lang.Nullable; @Builder public record StorageProtocolProps( - @NonNull StorageProtocolMode protocolMode, @Nullable H2Props h2Props, @Nullable PostgresProps postgresProps) {} + @NonNull StorageProtocolMode protocolMode, H2Props h2Props, PostgresProps postgresProps) {} diff --git a/pom.xml b/pom.xml index 1ca3e978..2e61adc0 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,7 @@ + org.apache.maven.plugins maven-enforcer-plugin 3.4.1 @@ -36,6 +37,7 @@ + org.apache.maven.plugins maven-install-plugin 3.1.1 @@ -43,6 +45,7 @@ + org.apache.maven.plugins maven-deploy-plugin 3.1.1 diff --git a/tests/e2e/pom.xml b/tests/e2e/pom.xml index a7de022f..db58b942 100644 --- a/tests/e2e/pom.xml +++ b/tests/e2e/pom.xml @@ -4,6 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + pom + smecalculus.bezmen tests diff --git a/tests/pom.xml b/tests/pom.xml index ecb529a8..e9023611 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -20,13 +20,6 @@ UTF-8 - - - github - https://maven.pkg.github.com/smecalculus/bezmen - - - @@ -102,7 +95,6 @@ 3.11.0 17 - UTF-8 org.projectlombok @@ -116,6 +108,14 @@ maven-surefire-plugin 3.1.2 + + org.apache.maven.plugins + maven-install-plugin + 3.1.1 + + true + + diff --git a/tools/pom.xml b/tools/pom.xml index f0735280..c9da0e98 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -4,14 +4,21 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + pom + smecalculus.bezmen tools latest + + UTF-8 + + + org.apache.maven.plugins maven-enforcer-plugin 3.4.1 @@ -27,6 +34,7 @@ + org.apache.maven.plugins maven-antrun-plugin 3.1.0 @@ -37,11 +45,20 @@ + + org.apache.maven.plugins + maven-install-plugin + 3.1.1 + + true + + + org.apache.maven.plugins maven-antrun-plugin From 3a3f6cf9d05925ad3f259c95af0bf177500e259f Mon Sep 17 00:00:00 2001 From: Pavel Vetokhin Date: Sat, 7 Oct 2023 20:29:23 +0300 Subject: [PATCH 4/5] Move test sepulka client --- .../bezmen/interior/construction/SepulkaClientBeans.java | 8 ++------ .../interior/messaging/SepulkaClientSpringWeb.java | 9 ++++----- 2 files changed, 6 insertions(+), 11 deletions(-) rename {apps/sepuling/src/test => libs/testing/src/main}/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWeb.java (77%) diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/interior/construction/SepulkaClientBeans.java b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/construction/SepulkaClientBeans.java index 7e500c2e..b9fb24e3 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/interior/construction/SepulkaClientBeans.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/construction/SepulkaClientBeans.java @@ -28,12 +28,8 @@ public SepulkaService sepulkaService() { } @Bean - SepulkaSliceMapper sepulkaConverter() { - return new SepulkaSliceMapperImpl(); - } - - @Bean - SepulkaClient internalClient(SepulkaService service, SepulkaSliceMapper mapper) { + SepulkaClient internalClient(SepulkaService service) { + SepulkaSliceMapper mapper = new SepulkaSliceMapperImpl(); return new SepulkaClientImpl(service, mapper); } diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWeb.java b/libs/testing/src/main/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWeb.java similarity index 77% rename from apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWeb.java rename to libs/testing/src/main/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWeb.java index 03b173a3..ea8e6d13 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWeb.java +++ b/libs/testing/src/main/java/smecalculus/bezmen/interior/messaging/SepulkaClientSpringWeb.java @@ -9,21 +9,20 @@ import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSlice; import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSliceMsg; -// TODO: подумать о том, чтобы перенести в testing, в messaging или в abstraction (prod or test jar) public record SepulkaClientSpringWeb(@NonNull WebTestClient client, @NonNull SepulkaMsgMapper mapper) implements SepulkaClient { @Override - public SepulkaRegisteredSlice register(SepulkaRegisterSlice command) { - SepulkaRegisteredSliceMsg response = client.post() + public SepulkaRegisteredSlice register(SepulkaRegisterSlice request) { + SepulkaRegisteredSliceMsg responseMsg = client.post() .uri("/sepulkas") .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) - .bodyValue(mapper.toMsg(command)) + .bodyValue(mapper.toMsg(request)) .exchange() .expectBody(SepulkaRegisteredSliceMsg.class) .returnResult() .getResponseBody(); - return mapper.toDomain(response); + return mapper.toDomain(responseMsg); } } From 6e8e5d0420ae4e1c8065d82b41368d625041c532 Mon Sep 17 00:00:00 2001 From: Pavel Vetokhin Date: Sat, 7 Oct 2023 20:35:28 +0300 Subject: [PATCH 5/5] Fix package name --- .../bezmen/interior/construction/MappingMyBatisBeans.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingMyBatisBeans.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingMyBatisBeans.java index dc9e5ad9..1cdbb189 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingMyBatisBeans.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingMyBatisBeans.java @@ -11,7 +11,7 @@ @Configuration(proxyBeanMethods = false) @ConditionalOnStateMappingMode(MY_BATIS) -@MapperScan(basePackages = "smecalculus.bezmen.storage.mybatis") +@MapperScan(basePackages = "smecalculus.bezmen.interior.storage.mybatis") public class MappingMyBatisBeans { @Bean