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

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

parent 3b3badd0
No related branches found
Tags
No related merge requests found
......@@ -15,9 +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.PostfachMessageCode;
import de.ozgcloud.nachrichten.postfach.PostfachNachricht;
import de.ozgcloud.nachrichten.postfach.StringBasedIdentifier;
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.VorgangManagerServerExtension;
import de.ozgcloud.nachrichten.postfach.osiv2.factory.PostfachAddressTestFactory;
......@@ -57,7 +59,6 @@ class OsiPostfachRemoteServiceRemoteITCase {
registry.add("grpc.client." + GRPC_FILE_MANAGER_NAME + ".negotiationType", () -> "PLAINTEXT");
}
@Autowired
protected Osi2AttachmentFileService osi2AttachmentFileService;
......@@ -93,6 +94,16 @@ class OsiPostfachRemoteServiceRemoteITCase {
.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")
@Test
void shouldReceiveMessages() {
......
package de.ozgcloud.nachrichten.postfach.osiv2.factory;
import java.util.UUID;
import de.ozgcloud.nachrichten.postfach.PostfachAddress;
import de.ozgcloud.nachrichten.postfach.StringBasedIdentifier;
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 PostfachAddress create() {
......@@ -15,7 +17,7 @@ public class PostfachAddressTestFactory {
public static PostfachAddress.PostfachAddressBuilder createBuilder() {
return PostfachAddress.builder()
.type(1)
.serviceKontoType("TYPE1")
.serviceKontoType(SERVICE_KONTO_TYPE)
.identifier(StringBasedIdentifier.builder()
.postfachId(MAILBOX_ID)
.build());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment