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
No related branches found
No related tags found
No related merge requests found
...@@ -51,17 +51,26 @@ class XtaITCase { ...@@ -51,17 +51,26 @@ class XtaITCase {
class TestRunGetXtaMessages { class TestRunGetXtaMessages {
@BeforeEach @BeforeEach
void setup() { void setup() {
// Mock 'start vorgang creation' mockStartVorgangCreation();
mockUploadBinaryFiles();
mockFinishVorgangCreation();
}
private void mockStartVorgangCreation() {
stubFor( stubFor(
unaryMethod(VorgangServiceGrpc.getStartCreationMethod()) unaryMethod(VorgangServiceGrpc.getStartCreationMethod())
.willReturn(GrpcCreateVorgangResponse.getDefaultInstance()) .willReturn(GrpcCreateVorgangResponse.getDefaultInstance())
); );
// Mock 'upload binary files' }
private void mockUploadBinaryFiles() {
stubFor( stubFor(
clientStreamingMethod(BinaryFileServiceGrpc.getUploadBinaryFileAsStreamMethod()) clientStreamingMethod(BinaryFileServiceGrpc.getUploadBinaryFileAsStreamMethod())
.willReturn(GrpcUploadBinaryFileResponse.getDefaultInstance()) .willReturn(GrpcUploadBinaryFileResponse.getDefaultInstance())
); );
// Mock 'finish vorgang creation' }
private void mockFinishVorgangCreation() {
stubFor( stubFor(
unaryMethod(VorgangServiceGrpc.getFinishCreationMethod()) unaryMethod(VorgangServiceGrpc.getFinishCreationMethod())
.willReturn(GrpcFinishCreationResponse.getDefaultInstance()) .willReturn(GrpcFinishCreationResponse.getDefaultInstance())
...@@ -71,7 +80,15 @@ class XtaITCase { ...@@ -71,7 +80,15 @@ class XtaITCase {
@AfterEach @AfterEach
void teardown() { void teardown() {
try { try {
// Expect one Vorgang to be created (start and finish) expectOneVorgangCreateAndFinishCall();
expectUploadCallForXmlRepresentations();
} finally {
xtaMocker.teardownServer();
resetMappings();
}
}
private void expectOneVorgangCreateAndFinishCall() {
verifyThat( verifyThat(
calledMethod(VorgangServiceGrpc.getStartCreationMethod()) calledMethod(VorgangServiceGrpc.getStartCreationMethod())
.withRequest(GrpcCreateVorgangRequest::hasEingang), .withRequest(GrpcCreateVorgangRequest::hasEingang),
...@@ -81,7 +98,10 @@ class XtaITCase { ...@@ -81,7 +98,10 @@ class XtaITCase {
calledMethod(VorgangServiceGrpc.getFinishCreationMethod()), calledMethod(VorgangServiceGrpc.getFinishCreationMethod()),
times(1) times(1)
); );
// Expect upload of two xml representations: xdomea.xml and antrag.xml }
private void expectUploadCallForXmlRepresentations() {
// Expect two xml representations: xdomea.xml and antrag.xml
verifyThat( verifyThat(
calledMethod(BinaryFileServiceGrpc.getUploadBinaryFileAsStreamMethod()) calledMethod(BinaryFileServiceGrpc.getUploadBinaryFileAsStreamMethod())
.withRequestsContaining(request -> .withRequestsContaining(request ->
...@@ -90,10 +110,6 @@ class XtaITCase { ...@@ -90,10 +110,6 @@ class XtaITCase {
), ),
times(2) times(2)
); );
} finally {
xtaMocker.teardownServer();
resetMappings();
}
} }
@DisplayName("should have three representations with pdf") @DisplayName("should have three representations with pdf")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment