Skip to content
Snippets Groups Projects
Commit 7e032509 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6944 mock responseOberver call

parent 8819c5b5
Branches
Tags
No related merge requests found
......@@ -411,6 +411,11 @@ class AntragraumITCase {
VorgangAttachedItem.COLLECTION_NAME);
}
@BeforeEach
void mockObserver() {
when(responseObserver.isReady()).thenReturn(true);
}
@Test
void shouldSendContent() {
when(verifier.verify(any())).thenReturn(Collections.emptyList());
......@@ -442,10 +447,7 @@ class AntragraumITCase {
.setFileId(fileId)
.build();
assertThatThrownBy(() -> grpcService.getAttachmentContent(request, responseObserver))
.isInstanceOf(SecurityException.class)
.hasMessageContaining("Signature missing")
.hasMessageContaining("invalid_signature");
verify(responseObserver, never()).onNext(any());
}
......@@ -460,10 +462,7 @@ class AntragraumITCase {
.setFileId(fileId)
.build();
assertThatThrownBy(() -> grpcService.getAttachmentContent(request, responseObserver))
.isInstanceOf(NotFoundException.class)
.hasMessageContaining("PostfachNachricht")
.hasMessageContaining(vorgangAttachedItem.getId());
verify(responseObserver, never()).onNext(any());
}
@Test
......@@ -478,10 +477,7 @@ class AntragraumITCase {
.setFileId(fileId)
.build();
assertThatThrownBy(() -> grpcService.getAttachmentContent(request, responseObserver))
.isInstanceOf(NotFoundException.class)
.hasMessageContaining("PostfachNachricht")
.hasMessageContaining(vorgangAttachedItem.getId());
verify(responseObserver, never()).onNext(any());
}
@Test
......@@ -496,10 +492,7 @@ class AntragraumITCase {
.setFileId(fileId)
.build();
assertThatThrownBy(() -> grpcService.getAttachmentContent(request, responseObserver))
.isInstanceOf(NotFoundException.class)
.hasMessageContaining("PostfachNachricht")
.hasMessageContaining(vorgangAttachedItemDifferentAttachment.getId());
verify(responseObserver, never()).onNext(any());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment