From 5316cb48d040cad4e84ee6057acee61772fd7df2 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 14 Mar 2021 10:15:01 +0100 Subject: [PATCH] WIP --- .../out}/RemoteUsersServiceConsumer.java | 6 +-- .../{adapter => adapters/out}/UserDTO.java | 2 +- .../demos/pwreset/domain/{ => api}/User.java | 2 +- .../domain/{ => api}/UsersService.java | 2 +- pwreset/src/main/resources/templates/400.html | 15 ++++++ .../src/main/resources/templates/error.html | 51 +++++++++++++++++++ .../src/main/resources/templates/home.html | 25 +++++++++ .../src/main/resources/templates/layout.html | 20 ++++++++ .../out}/RemoteUsersServiceConsumerIT.java | 4 +- 9 files changed, 119 insertions(+), 8 deletions(-) rename pwreset/src/main/java/de/juplo/demos/pwreset/{adapter => adapters/out}/RemoteUsersServiceConsumer.java (87%) rename pwreset/src/main/java/de/juplo/demos/pwreset/{adapter => adapters/out}/UserDTO.java (70%) rename pwreset/src/main/java/de/juplo/demos/pwreset/domain/{ => api}/User.java (77%) rename pwreset/src/main/java/de/juplo/demos/pwreset/domain/{ => api}/UsersService.java (72%) create mode 100644 pwreset/src/main/resources/templates/400.html create mode 100644 pwreset/src/main/resources/templates/error.html create mode 100644 pwreset/src/main/resources/templates/home.html create mode 100644 pwreset/src/main/resources/templates/layout.html rename pwreset/src/test/java/de/juplo/demos/pwreset/{adapter => adapters/out}/RemoteUsersServiceConsumerIT.java (96%) diff --git a/pwreset/src/main/java/de/juplo/demos/pwreset/adapter/RemoteUsersServiceConsumer.java b/pwreset/src/main/java/de/juplo/demos/pwreset/adapters/out/RemoteUsersServiceConsumer.java similarity index 87% rename from pwreset/src/main/java/de/juplo/demos/pwreset/adapter/RemoteUsersServiceConsumer.java rename to pwreset/src/main/java/de/juplo/demos/pwreset/adapters/out/RemoteUsersServiceConsumer.java index 27fdc8f..eb1492f 100644 --- a/pwreset/src/main/java/de/juplo/demos/pwreset/adapter/RemoteUsersServiceConsumer.java +++ b/pwreset/src/main/java/de/juplo/demos/pwreset/adapters/out/RemoteUsersServiceConsumer.java @@ -1,7 +1,7 @@ -package de.juplo.demos.pwreset.adapter; +package de.juplo.demos.pwreset.adapters.out; -import de.juplo.demos.pwreset.domain.User; -import de.juplo.demos.pwreset.domain.UsersService; +import de.juplo.demos.pwreset.domain.api.User; +import de.juplo.demos.pwreset.domain.api.UsersService; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/pwreset/src/main/java/de/juplo/demos/pwreset/adapter/UserDTO.java b/pwreset/src/main/java/de/juplo/demos/pwreset/adapters/out/UserDTO.java similarity index 70% rename from pwreset/src/main/java/de/juplo/demos/pwreset/adapter/UserDTO.java rename to pwreset/src/main/java/de/juplo/demos/pwreset/adapters/out/UserDTO.java index 4f6bd38..640df61 100644 --- a/pwreset/src/main/java/de/juplo/demos/pwreset/adapter/UserDTO.java +++ b/pwreset/src/main/java/de/juplo/demos/pwreset/adapters/out/UserDTO.java @@ -1,4 +1,4 @@ -package de.juplo.demos.pwreset.adapter; +package de.juplo.demos.pwreset.adapters.out; import lombok.Setter; diff --git a/pwreset/src/main/java/de/juplo/demos/pwreset/domain/User.java b/pwreset/src/main/java/de/juplo/demos/pwreset/domain/api/User.java similarity index 77% rename from pwreset/src/main/java/de/juplo/demos/pwreset/domain/User.java rename to pwreset/src/main/java/de/juplo/demos/pwreset/domain/api/User.java index 3d970bd..9b7f913 100644 --- a/pwreset/src/main/java/de/juplo/demos/pwreset/domain/User.java +++ b/pwreset/src/main/java/de/juplo/demos/pwreset/domain/api/User.java @@ -1,4 +1,4 @@ -package de.juplo.demos.pwreset.domain; +package de.juplo.demos.pwreset.domain.api; import lombok.Builder; import lombok.Data; diff --git a/pwreset/src/main/java/de/juplo/demos/pwreset/domain/UsersService.java b/pwreset/src/main/java/de/juplo/demos/pwreset/domain/api/UsersService.java similarity index 72% rename from pwreset/src/main/java/de/juplo/demos/pwreset/domain/UsersService.java rename to pwreset/src/main/java/de/juplo/demos/pwreset/domain/api/UsersService.java index 0a07a1f..0580bd5 100644 --- a/pwreset/src/main/java/de/juplo/demos/pwreset/domain/UsersService.java +++ b/pwreset/src/main/java/de/juplo/demos/pwreset/domain/api/UsersService.java @@ -1,4 +1,4 @@ -package de.juplo.demos.pwreset.domain; +package de.juplo.demos.pwreset.domain.api; import java.util.Optional; diff --git a/pwreset/src/main/resources/templates/400.html b/pwreset/src/main/resources/templates/400.html new file mode 100644 index 0000000..36ba0c0 --- /dev/null +++ b/pwreset/src/main/resources/templates/400.html @@ -0,0 +1,15 @@ + + + + Testing Exception-Handling - Template for 400 + + + + +

Template for 400

+
+

EXCEPTION

+

Back to HOME

+
+ + diff --git a/pwreset/src/main/resources/templates/error.html b/pwreset/src/main/resources/templates/error.html new file mode 100644 index 0000000..a5e8149 --- /dev/null +++ b/pwreset/src/main/resources/templates/error.html @@ -0,0 +1,51 @@ + + + + XXX: ERROR + + + + +

XXX: ERROR

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StatusERROR.STATUS
ErrorERROR.ERROR
MessageERROR.MESSAGE
Request-IDERROR.REQUEST_ID
TimstampERROR.TIMESTAMP
PathERROR.PATH
Trace +
+
ERROR.TRACE
+
+
+

Back to HOME + + + diff --git a/pwreset/src/main/resources/templates/home.html b/pwreset/src/main/resources/templates/home.html new file mode 100644 index 0000000..cb75a1d --- /dev/null +++ b/pwreset/src/main/resources/templates/home.html @@ -0,0 +1,25 @@ + + + + Home + + + + +

Home

+
+ +
+
+

+ + This page links to the pages, that are served by the dynamically created beans. + +

+
+ + diff --git a/pwreset/src/main/resources/templates/layout.html b/pwreset/src/main/resources/templates/layout.html new file mode 100644 index 0000000..3ad68ed --- /dev/null +++ b/pwreset/src/main/resources/templates/layout.html @@ -0,0 +1,20 @@ + + + + + + TITLE + + + + +
+
+

HEADER

+
BODY
+
+
+ + diff --git a/pwreset/src/test/java/de/juplo/demos/pwreset/adapter/RemoteUsersServiceConsumerIT.java b/pwreset/src/test/java/de/juplo/demos/pwreset/adapters/out/RemoteUsersServiceConsumerIT.java similarity index 96% rename from pwreset/src/test/java/de/juplo/demos/pwreset/adapter/RemoteUsersServiceConsumerIT.java rename to pwreset/src/test/java/de/juplo/demos/pwreset/adapters/out/RemoteUsersServiceConsumerIT.java index fb784ad..3724a65 100644 --- a/pwreset/src/test/java/de/juplo/demos/pwreset/adapter/RemoteUsersServiceConsumerIT.java +++ b/pwreset/src/test/java/de/juplo/demos/pwreset/adapters/out/RemoteUsersServiceConsumerIT.java @@ -1,4 +1,4 @@ -package de.juplo.demos.pwreset.adapter; +package de.juplo.demos.pwreset.adapters.out; import au.com.dius.pact.consumer.MockServer; import au.com.dius.pact.consumer.dsl.PactDslWithProvider; @@ -6,7 +6,7 @@ import au.com.dius.pact.consumer.junit5.PactConsumerTestExt; import au.com.dius.pact.consumer.junit5.PactTestFor; import au.com.dius.pact.core.model.RequestResponsePact; import au.com.dius.pact.core.model.annotations.Pact; -import de.juplo.demos.pwreset.domain.User; +import de.juplo.demos.pwreset.domain.api.User; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.web.client.RestTemplateBuilder; -- 2.20.1