diff --git a/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteService.java b/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteService.java index a3d3ccdbf31cf972eb11c14d4891a93ecfaafe5c..c03d4e681f51ff7a38fb4741ac21e92e187638e6 100644 --- a/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteService.java +++ b/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteService.java @@ -34,7 +34,7 @@ public class OsiPostfachRemoteService implements PostfachRemoteService { public Stream<PostfachNachricht> getAllMessages() { try { return postfachApiFacadeService.receiveMessages(); - }catch (RuntimeException e) { + } catch (RuntimeException e) { throw new OsiPostfachException("Failed to get messages", e); } } diff --git a/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/config/ApiClientConfiguration.java b/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/config/ApiClientConfiguration.java index 82ea45f9be3c833242551186e6f7fea9e400c9c7..a0d414ec0f8b44661bc2a9dd1dda47983f17eb66 100644 --- a/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/config/ApiClientConfiguration.java +++ b/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/config/ApiClientConfiguration.java @@ -51,8 +51,7 @@ public class ApiClientConfiguration { } private RestClient restClient(ClientRegistrationRepository clientRegistrations) { - OAuth2ClientHttpRequestInterceptor requestInterceptor = - new OAuth2ClientHttpRequestInterceptor(authorizedClientManager(clientRegistrations)); + var requestInterceptor = new OAuth2ClientHttpRequestInterceptor(authorizedClientManager(clientRegistrations)); requestInterceptor.setClientRegistrationIdResolver(request -> "osi2"); return defaultRestClientBuilder() diff --git a/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/config/Osi2PostfachProperties.java b/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/config/Osi2PostfachProperties.java index f5a3d44421b73db9566abbe773b7d2d54fc28b84..6d4bb53ccd296a1d687bb7701480eebfdeaf63da 100644 --- a/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/config/Osi2PostfachProperties.java +++ b/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/config/Osi2PostfachProperties.java @@ -17,7 +17,7 @@ import lombok.Setter; @RequiredArgsConstructor public class Osi2PostfachProperties { - public static final String PREFIX = "ozgcloud.osiv2-postfach"; + static final String PREFIX = "ozgcloud.osiv2"; private boolean enabled; @@ -47,7 +47,7 @@ public class Osi2PostfachProperties { @Configuration @ConfigurationProperties(prefix = ProxyConfiguration.PREFIX) public static class ProxyConfiguration { - static final String PREFIX = Osi2PostfachProperties.PREFIX + ".http-proxy"; + static final String PREFIX = Osi2PostfachProperties.PREFIX + ".proxy"; private boolean enabled; diff --git a/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/transfer/PostfachApiFacadeService.java b/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/transfer/PostfachApiFacadeService.java index b2b14991c3dca01b23e9b8102149c8b4351ecc89..d11c556369fb8c3a892d1be7c46476c0b7298ca6 100644 --- a/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/transfer/PostfachApiFacadeService.java +++ b/src/main/java/de/ozgcloud/nachrichten/postfach/osiv2/transfer/PostfachApiFacadeService.java @@ -25,7 +25,7 @@ public class PostfachApiFacadeService { private final Osi2RequestMapper osi2RequestMapper; private final Osi2ResponseMapper osi2ResponseMapper; - private static int MAX_NUMBER_RECEIVED_MESSAGES = 100; + private static final int MAX_NUMBER_RECEIVED_MESSAGES = 100; public void sendMessage(PostfachNachricht nachricht) { messageExchangeApi.sendMessage( 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 f75663dd923194920575f7de28395327bb6bd10f..d521985848e025dc5f2b12b1fba15e3d2d99a0ee 100644 --- a/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceITCase.java +++ b/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceITCase.java @@ -40,7 +40,7 @@ import lombok.SneakyThrows; @SpringBootTest(classes = TestApplication.class) @ActiveProfiles({"stage", "itcase"}) @TestPropertySource(properties = { - "ozgcloud.osiv2-postfach.http-proxy.enabled=false", + "ozgcloud.osiv2.proxy.enabled=false", }) class OsiPostfachRemoteServiceITCase { @@ -62,8 +62,8 @@ class OsiPostfachRemoteServiceITCase { registry.add("spring.security.oauth2.client.provider.osi2.token-uri", OSI_MOCK_SERVER_EXTENSION::getAccessTokenUrl); registry.add("spring.security.oauth2.client.registration.osi2.scope", () -> CLIENT_SCOPES); registry.add("spring.security.oauth2.client.registration.osi2.client-id", () -> CLIENT_ID); - registry.add("ozgcloud.osiv2-postfach.api.url", OSI_MOCK_SERVER_EXTENSION::getPostfachFacadeUrl); - registry.add("ozgcloud.osiv2-postfach.api.resource", () -> RESOURCE_URN); + registry.add("ozgcloud.osiv2.api.url", OSI_MOCK_SERVER_EXTENSION::getPostfachFacadeUrl); + registry.add("ozgcloud.osiv2.api.resource", () -> RESOURCE_URN); } private MockServerClient postfachFacadeMockClient; 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 27c5c05c959d24538be689bc7b8a252654e83b03..482ed08e7a448aa564d66a9f85612bb976db5faf 100644 --- a/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceRemoteITCase.java +++ b/src/test/java/de/ozgcloud/nachrichten/postfach/osiv2/OsiPostfachRemoteServiceRemoteITCase.java @@ -46,11 +46,11 @@ public class OsiPostfachRemoteServiceRemoteITCase { () -> System.getenv("SH_STAGE_CLIENT_SECRET") ); registry.add( - "ozgcloud.osiv2-postfach.http-proxy.host", + "ozgcloud.osiv2.proxy.host", () -> matchProxyRegex(System.getenv("HTTP_PROXY")).group(1) ); registry.add( - "ozgcloud.osiv2-postfach.http-proxy.port", + "ozgcloud.osiv2.proxy.port", () -> matchProxyRegex(System.getenv("HTTP_PROXY")).group(2) ); } @@ -63,7 +63,6 @@ public class OsiPostfachRemoteServiceRemoteITCase { throw new IllegalArgumentException("Proxy host and port not found in '%s'".formatted(text)); } - @Disabled @DisplayName("send message") @Nested class TestSendMessage { @@ -90,7 +89,6 @@ public class OsiPostfachRemoteServiceRemoteITCase { } } - @Disabled @DisplayName("delete message") @Nested class TestDeleteMessageById {