diff --git a/pom.xml b/pom.xml index 8991d23be73cbebb2a7423036720a206fef83692..86abf554db5dbbe339c6de49ccebfa67e275097b 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ <groupId>de.ozgcloud.osiv2</groupId> <artifactId>osiv2-postfach</artifactId> - <version>0.1.1-SNAPSHOT</version> + <version>0.1.0-SNAPSHOT</version> <name>OZG-Cloud-OSIv2-Postfach</name> <description>OSIv2-Postfach-Anbindung für OZG-Cloud-Nachrichten</description> @@ -25,6 +25,11 @@ </properties> <dependencies> <!-- OZG-Cloud --> + <dependency> + <groupId>de.ozgcloud.api-lib</groupId> + <artifactId>ozg-cloud-spring-boot-starter</artifactId> + <version>${api-lib.version}</version> + </dependency> <dependency> <groupId>de.ozgcloud.nachrichten</groupId> <artifactId>nachrichten-manager-postfach-interface</artifactId> diff --git a/src/main/resources/application-stage.yml b/src/main/resources/application-stage.yml new file mode 100644 index 0000000000000000000000000000000000000000..f7c2e25fa9b462d89ff9045664c8fe74e724717a --- /dev/null +++ b/src/main/resources/application-stage.yml @@ -0,0 +1,26 @@ +spring: + security: + oauth2: + client: + registration: + osi2: + client-id: 'OZG-Kopfstelle' + client-secret: 'changeme' + scope: default, access_urn:dataport:osi:sh:stage:ozgkopfstelle + authorization-grant-type: 'client_credentials' + client-authentication-method: client_secret_post + provider: + osi2: + token-uri: 'https://idp.serviceportal-stage.schleswig-holstein.de/webidp2/connect/token' +ozgcloud: + osiv2-postfach: + enabled: true + api: + resource: 'urn:dataport:osi:postfach:rz2:stage:sh' + url: 'https://api-gateway-stage.dataport.de:443/api/osi_postfach/1.0.0' + tenant: 'SH' + name-identifier: 'ozgkopfstelle' + http-proxy: + enabled: true + host: 127.0.0.1 + port: 3128 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1d1f1bfdbe712e2d12c318c56688941da6a7b2aa..065fffe83bf04cd7a435ee3d7a96b347b2f9379e 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,28 +1,3 @@ spring: jackson: - default-property-inclusion: NON_NULL - security: - oauth2: - client: - registration: - osi2: - client-id: 'OZG-Kopfstelle' - client-secret: 'changeme' - scope: default, access_urn:dataport:osi:sh:stage:ozgkopfstelle - authorization-grant-type: 'client_credentials' - client-authentication-method: client_secret_post - provider: - osi2: - token-uri: 'https://idp.serviceportal-stage.schleswig-holstein.de/webidp2/connect/token' -ozgcloud: - osiv2-postfach: - enabled: false - api: - resource: 'urn:dataport:osi:postfach:rz2:stage:sh' - url: 'https://api-gateway-stage.dataport.de:443/api/osi_postfach/1.0.0' - tenant: 'SH' - name-identifier: 'ozgkopfstelle' - http-proxy: - enabled: true - host: 127.0.0.1 - port: 3128 + default-property-inclusion: NON_NULL \ No newline at end of file diff --git a/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceITCase.java b/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceITCase.java index 2771bbda602f4abcee66c4c946c6c093223a4c32..dcfa4c5fc70b0b03ad6b6782ea3e5a8ef6b9a374 100644 --- a/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceITCase.java +++ b/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceITCase.java @@ -38,7 +38,7 @@ import de.ozgcloud.nachrichten.postfach.osiv2.gen.model.MessageExchangeReceiveMe import lombok.SneakyThrows; @SpringBootTest(classes = TestApplication.class) -@ActiveProfiles("itcase") +@ActiveProfiles({"itcase", "stage"}) @TestPropertySource(properties = { "ozgcloud.osiv2-postfach.http-proxy.enabled=false", }) diff --git a/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceRemoteITCase.java b/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceRemoteITCase.java index 9978f987a8d331528a8a8b86b4bf1ed0b21348a4..9301a3769ee5864b185ce1634aa0e54d1f3056ec 100644 --- a/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceRemoteITCase.java +++ b/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceRemoteITCase.java @@ -23,7 +23,7 @@ import de.ozgcloud.nachrichten.postfach.osiv2.factory.PostfachAddressTestFactory import de.ozgcloud.nachrichten.postfach.osiv2.factory.PostfachNachrichtTestFactory; @SpringBootTest(classes = TestApplication.class) -@ActiveProfiles("local") +@ActiveProfiles({ "local", "stage" }) @EnabledIfEnvironmentVariable(named = "SH_STAGE_CLIENT_SECRET", matches = ".+") public class OsiPostfachRemoteServiceRemoteITCase { @@ -78,10 +78,10 @@ public class OsiPostfachRemoteServiceRemoteITCase { @DisplayName("receive all messages") @Nested - class TestReceiveAllMessages{ + class TestReceiveAllMessages { @Test - void shouldReceiveAllMessage(){ + void shouldReceiveAllMessage() { Stream<PostfachNachricht> allMessages = osiPostfachRemoteService.getAllMessages(); var messages = allMessages.toList(); @@ -93,10 +93,10 @@ public class OsiPostfachRemoteServiceRemoteITCase { @Disabled @DisplayName("delete message") @Nested - class TestDeleteMessageById{ + class TestDeleteMessageById { @Test - void shouldDeleteMessage(){ + void shouldDeleteMessage() { assertThatCode(() -> osiPostfachRemoteService.deleteMessage("5dd65c1e-bd41-4c3d-bf98-be769ca341dc")) .doesNotThrowAnyException(); } diff --git a/src/test/resources/application-itcase.yml b/src/test/resources/application-itcase.yml index d8cacf79a13dd9feec526bea7afc6695e6f0b136..dcbea65d1bba45b8c4882d109a07064f09581a61 100644 --- a/src/test/resources/application-itcase.yml +++ b/src/test/resources/application-itcase.yml @@ -1,6 +1,3 @@ -ozgcloud: - osiv2-postfach: - enabled: true logging: level: de.ozgcloud.nachrichten.postfach.osiv2: DEBUG