Skip to content
Snippets Groups Projects
Commit 4b0192e0 authored by Jan Zickermann's avatar Jan Zickermann
Browse files

WIP sh-stage: Try out sendMessage in

parent 7db9c63f
Branches
Tags 2.15.1
No related merge requests found
Pipeline #1205 passed
......@@ -9,7 +9,7 @@ Anbindung des OSIv2-Postfachs für die OZG-Cloud.
Die Client-Authentifizierung beim Authentication-Server (Servicekonto) erfolgt über den OAuth2-Client-Credentials-Flow (siehe [RFC 6749, Sec. 1.3.4](https://www.rfc-editor.org/rfc/rfc6749#section-1.3.4))
mit `client_id` und `client_secret` in Verbindung mit einem Resource-URI-Parameter (siehe [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707)), der den Zugriff des Clients auf den Resource-Server (Postfach-Facade) einschränkt.
Der Resource-Server liest die Resource-URI aus dem `aud`-Claim (siehe [RFC 9068, Sec. 3](https://datatracker.ietf.org/doc/html/rfc9068#section-3)).
Der Resource-Server liest die Resource-URI aus dem `aud`-Claim (siehe [RFC 9068, Sec. 3](https://datatracker.ietf.org/doc/html/rfc9068#section-3) und [ServicePortal-Dokumentation](https://idp.serviceportal-stage.hamburg.de/doc/external/articles/OIDC/OIDC-Protokoll.html)).
### Beispiel:
......
......@@ -15,6 +15,11 @@ import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource;
import de.ozgcloud.nachrichten.postfach.PostfachNachricht;
import de.ozgcloud.nachrichten.postfach.osiv2.factory.DummyStringBasedIdentifier;
import de.ozgcloud.nachrichten.postfach.osiv2.factory.PostfachAddressTestFactory;
import de.ozgcloud.nachrichten.postfach.osiv2.factory.PostfachNachrichtTestFactory;
@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.NONE)
@ActiveProfiles("itcase")
@EnabledIfEnvironmentVariable(named = "SH_STAGE_CLIENT_SECRET", matches = ".+")
......@@ -23,6 +28,14 @@ public class OsiPostfachRemoteServiceRemoteITCase {
@Autowired
private OsiPostfachRemoteService osiPostfachRemoteService;
private final PostfachNachricht nachricht = PostfachNachrichtTestFactory.createBuilder()
.postfachAddress(PostfachAddressTestFactory.createBuilder()
.identifier(DummyStringBasedIdentifier.builder()
.mailboxId("53ae88a0-6b06-44d0-8b13-e7b547fcaa6b")
.build())
.build())
.build();
@DynamicPropertySource
static void dynamicProperties(DynamicPropertyRegistry registry) {
registry.add(
......@@ -54,7 +67,7 @@ public class OsiPostfachRemoteServiceRemoteITCase {
@DisplayName("should not fail")
@Test
void shouldNotFail() {
assertThatCode(() -> osiPostfachRemoteService.getAllMessages())
assertThatCode(() -> osiPostfachRemoteService.sendMessage(nachricht))
.doesNotThrowAnyException();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment