Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eingang-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
eingang-manager
Commits
88a2b0ac
Commit
88a2b0ac
authored
11 months ago
by
Jan Zickermann
Browse files
Options
Downloads
Patches
Plain Diff
OZG-5415 Use method names as comments
parent
312d5287
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xta-adapter/src/test/java/de/ozgcloud/eingang/xta/XtaITCase.java
+38
-22
38 additions, 22 deletions
...pter/src/test/java/de/ozgcloud/eingang/xta/XtaITCase.java
with
38 additions
and
22 deletions
xta-adapter/src/test/java/de/ozgcloud/eingang/xta/XtaITCase.java
+
38
−
22
View file @
88a2b0ac
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment