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

OZG-4097 remote-itcase: Test 404 returned by stage postfach

parent 0dbc2cf2
Branches
Tags
1 merge request!15Ozg 4097 senden und empfangen von anhängen
Pipeline #1758 failed
...@@ -15,9 +15,11 @@ import org.springframework.test.context.ActiveProfiles; ...@@ -15,9 +15,11 @@ import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.DynamicPropertyRegistry; import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource; import org.springframework.test.context.DynamicPropertySource;
import de.ozgcloud.nachrichten.postfach.PostfachMessageCode;
import de.ozgcloud.nachrichten.postfach.PostfachNachricht; import de.ozgcloud.nachrichten.postfach.PostfachNachricht;
import de.ozgcloud.nachrichten.postfach.StringBasedIdentifier; import de.ozgcloud.nachrichten.postfach.StringBasedIdentifier;
import de.ozgcloud.nachrichten.postfach.osiv2.attachment.Osi2AttachmentFileService; import de.ozgcloud.nachrichten.postfach.osiv2.attachment.Osi2AttachmentFileService;
import de.ozgcloud.nachrichten.postfach.osiv2.exception.Osi2PostfachException;
import de.ozgcloud.nachrichten.postfach.osiv2.extension.AttachmentExampleUploadUtil; import de.ozgcloud.nachrichten.postfach.osiv2.extension.AttachmentExampleUploadUtil;
import de.ozgcloud.nachrichten.postfach.osiv2.extension.VorgangManagerServerExtension; import de.ozgcloud.nachrichten.postfach.osiv2.extension.VorgangManagerServerExtension;
import de.ozgcloud.nachrichten.postfach.osiv2.factory.PostfachAddressTestFactory; import de.ozgcloud.nachrichten.postfach.osiv2.factory.PostfachAddressTestFactory;
...@@ -57,7 +59,6 @@ class OsiPostfachRemoteServiceRemoteITCase { ...@@ -57,7 +59,6 @@ class OsiPostfachRemoteServiceRemoteITCase {
registry.add("grpc.client." + GRPC_FILE_MANAGER_NAME + ".negotiationType", () -> "PLAINTEXT"); registry.add("grpc.client." + GRPC_FILE_MANAGER_NAME + ".negotiationType", () -> "PLAINTEXT");
} }
@Autowired @Autowired
protected Osi2AttachmentFileService osi2AttachmentFileService; protected Osi2AttachmentFileService osi2AttachmentFileService;
...@@ -93,6 +94,16 @@ class OsiPostfachRemoteServiceRemoteITCase { ...@@ -93,6 +94,16 @@ class OsiPostfachRemoteServiceRemoteITCase {
.doesNotThrowAnyException(); .doesNotThrowAnyException();
} }
@DisplayName("should throw postfach exception with unknown postfach id error code")
@Test
void shouldThrowPostfachExceptionWithUnknownPostfachIdErrorCode() {
var nachrichtWithUnknownPostfachId = PostfachNachrichtTestFactory.create();
assertThatThrownBy(() -> osiPostfachRemoteService.sendMessage(nachrichtWithUnknownPostfachId))
.isInstanceOf(Osi2PostfachException.class)
.hasFieldOrPropertyWithValue("messageCode", PostfachMessageCode.SEND_FAILED_UNKNOWN_POSTFACH_ID_MESSAGE_CODE);
}
@DisplayName("should receive messages") @DisplayName("should receive messages")
@Test @Test
void shouldReceiveMessages() { void shouldReceiveMessages() {
......
package de.ozgcloud.nachrichten.postfach.osiv2.factory; package de.ozgcloud.nachrichten.postfach.osiv2.factory;
import java.util.UUID;
import de.ozgcloud.nachrichten.postfach.PostfachAddress; import de.ozgcloud.nachrichten.postfach.PostfachAddress;
import de.ozgcloud.nachrichten.postfach.StringBasedIdentifier; import de.ozgcloud.nachrichten.postfach.StringBasedIdentifier;
public class PostfachAddressTestFactory { public class PostfachAddressTestFactory {
public static final String MAILBOX_ID = "testMailboxId"; public static final String MAILBOX_ID = UUID.randomUUID().toString();
public static final String SERVICE_KONTO_TYPE = "TYPE1"; public static final String SERVICE_KONTO_TYPE = "TYPE1";
public static PostfachAddress create() { public static PostfachAddress create() {
...@@ -15,7 +17,7 @@ public class PostfachAddressTestFactory { ...@@ -15,7 +17,7 @@ public class PostfachAddressTestFactory {
public static PostfachAddress.PostfachAddressBuilder createBuilder() { public static PostfachAddress.PostfachAddressBuilder createBuilder() {
return PostfachAddress.builder() return PostfachAddress.builder()
.type(1) .type(1)
.serviceKontoType("TYPE1") .serviceKontoType(SERVICE_KONTO_TYPE)
.identifier(StringBasedIdentifier.builder() .identifier(StringBasedIdentifier.builder()
.postfachId(MAILBOX_ID) .postfachId(MAILBOX_ID)
.build()); .build());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment