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

OZG-5415 Use method names as comments

parent 312d5287
Branches
Tags
No related merge requests found
......@@ -51,17 +51,26 @@ class XtaITCase {
class TestRunGetXtaMessages {
@BeforeEach
void setup() {
// Mock 'start vorgang creation'
mockStartVorgangCreation();
mockUploadBinaryFiles();
mockFinishVorgangCreation();
}
private void mockStartVorgangCreation() {
stubFor(
unaryMethod(VorgangServiceGrpc.getStartCreationMethod())
.willReturn(GrpcCreateVorgangResponse.getDefaultInstance())
);
// Mock 'upload binary files'
}
private void mockUploadBinaryFiles() {
stubFor(
clientStreamingMethod(BinaryFileServiceGrpc.getUploadBinaryFileAsStreamMethod())
.willReturn(GrpcUploadBinaryFileResponse.getDefaultInstance())
);
// Mock 'finish vorgang creation'
}
private void mockFinishVorgangCreation() {
stubFor(
unaryMethod(VorgangServiceGrpc.getFinishCreationMethod())
.willReturn(GrpcFinishCreationResponse.getDefaultInstance())
......@@ -71,31 +80,38 @@ class XtaITCase {
@AfterEach
void teardown() {
try {
// Expect one Vorgang to be created (start and finish)
verifyThat(
calledMethod(VorgangServiceGrpc.getStartCreationMethod())
.withRequest(GrpcCreateVorgangRequest::hasEingang),
times(1)
);
verifyThat(
calledMethod(VorgangServiceGrpc.getFinishCreationMethod()),
times(1)
);
// Expect upload of two xml representations: xdomea.xml and antrag.xml
verifyThat(
calledMethod(BinaryFileServiceGrpc.getUploadBinaryFileAsStreamMethod())
.withRequestsContaining(request ->
request.hasMetadata() &&
request.getMetadata().getContentType().contains("xml")
),
times(2)
);
expectOneVorgangCreateAndFinishCall();
expectUploadCallForXmlRepresentations();
} finally {
xtaMocker.teardownServer();
resetMappings();
}
}
private void expectOneVorgangCreateAndFinishCall() {
verifyThat(
calledMethod(VorgangServiceGrpc.getStartCreationMethod())
.withRequest(GrpcCreateVorgangRequest::hasEingang),
times(1)
);
verifyThat(
calledMethod(VorgangServiceGrpc.getFinishCreationMethod()),
times(1)
);
}
private void expectUploadCallForXmlRepresentations() {
// Expect two xml representations: xdomea.xml and antrag.xml
verifyThat(
calledMethod(BinaryFileServiceGrpc.getUploadBinaryFileAsStreamMethod())
.withRequestsContaining(request ->
request.hasMetadata() &&
request.getMetadata().getContentType().contains("xml")
),
times(2)
);
}
@DisplayName("should have three representations with pdf")
@TestZipFileNamesWithPdf
void shouldHaveThreeRepresentationsWithPdf(String zipFileName) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment