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
7e8dd494
Commit
7e8dd494
authored
1 year ago
by
Jan Zickermann
Browse files
Options
Downloads
Patches
Plain Diff
OZG-5415 XtaRemoteITCase: Fix capturing all eingangs
parent
8d6d9f55
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
xta-adapter/src/test/java/de/ozgcloud/eingang/xta/XtaRemoteITCase.java
+24
-15
24 additions, 15 deletions
...rc/test/java/de/ozgcloud/eingang/xta/XtaRemoteITCase.java
xta-adapter/src/test/resources/application-itcase.yml
+1
-1
1 addition, 1 deletion
xta-adapter/src/test/resources/application-itcase.yml
with
25 additions
and
16 deletions
xta-adapter/src/test/java/de/ozgcloud/eingang/xta/XtaRemoteITCase.java
+
24
−
15
View file @
7e8dd494
...
@@ -3,8 +3,10 @@ package de.ozgcloud.eingang.xta;
...
@@ -3,8 +3,10 @@ package de.ozgcloud.eingang.xta;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.*;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.*;
import
static
org
.
grpcmock
.
GrpcMock
.*;
import
static
org
.
grpcmock
.
GrpcMock
.*;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
import
org.grpcmock.interceptors.CapturedRequest
;
import
org.grpcmock.springboot.AutoConfigureGrpcMock
;
import
org.grpcmock.springboot.AutoConfigureGrpcMock
;
import
org.junit.jupiter.api.AfterEach
;
import
org.junit.jupiter.api.AfterEach
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.BeforeEach
;
...
@@ -18,7 +20,6 @@ import org.springframework.context.annotation.Bean;
...
@@ -18,7 +20,6 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.test.context.ActiveProfiles
;
import
org.springframework.test.context.ActiveProfiles
;
import
de.ozgcloud.eingang.Application
;
import
de.ozgcloud.eingang.Application
;
import
de.ozgcloud.eingang.semantik.SemantikAdapter
;
import
de.ozgcloud.vorgang.grpc.binaryFile.BinaryFileServiceGrpc
;
import
de.ozgcloud.vorgang.grpc.binaryFile.BinaryFileServiceGrpc
;
import
de.ozgcloud.vorgang.grpc.binaryFile.GrpcUploadBinaryFileResponse
;
import
de.ozgcloud.vorgang.grpc.binaryFile.GrpcUploadBinaryFileResponse
;
import
de.ozgcloud.vorgang.vorgang.GrpcCreateVorgangRequest
;
import
de.ozgcloud.vorgang.vorgang.GrpcCreateVorgangRequest
;
...
@@ -26,13 +27,11 @@ import de.ozgcloud.vorgang.vorgang.GrpcCreateVorgangResponse;
...
@@ -26,13 +27,11 @@ import de.ozgcloud.vorgang.vorgang.GrpcCreateVorgangResponse;
import
de.ozgcloud.vorgang.vorgang.GrpcEingang
;
import
de.ozgcloud.vorgang.vorgang.GrpcEingang
;
import
de.ozgcloud.vorgang.vorgang.GrpcFinishCreationResponse
;
import
de.ozgcloud.vorgang.vorgang.GrpcFinishCreationResponse
;
import
de.ozgcloud.vorgang.vorgang.VorgangServiceGrpc
;
import
de.ozgcloud.vorgang.vorgang.VorgangServiceGrpc
;
import
lombok.RequiredArgsConstructor
;
@Disabled
(
"real live test - do only activate for manual testing (will empty XTA-E mailbox)"
)
@Disabled
(
"real live test - do only activate for manual testing (will empty XTA-E mailbox)"
)
@SpringBootTest
(
classes
=
{
@SpringBootTest
(
classes
=
{
Application
.
class
,
Application
.
class
,
XtaRemoteITCase
.
ActivateXTARunnerConfig
.
class
,
XtaRemoteITCase
.
ActivateXTARunnerConfig
.
class
,
XtaRemoteITCase
.
ActivateXTARunnerConfig
.
class
},
properties
=
{
"ozgcloud.xta.server.name=LI33-0005"
,
},
properties
=
{
"ozgcloud.xta.server.name=LI33-0005"
,
"ozgcloud.xta.server.address=LI33-0005:3000"
,
"ozgcloud.xta.server.address=LI33-0005:3000"
,
"ozgcloud.xta.server.protocol=https"
,
"ozgcloud.xta.server.protocol=https"
,
...
@@ -50,19 +49,29 @@ class XtaRemoteITCase {
...
@@ -50,19 +49,29 @@ class XtaRemoteITCase {
@DisplayName
(
"run get xta messages"
)
@DisplayName
(
"run get xta messages"
)
@Nested
@Nested
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
())
...
@@ -87,6 +96,7 @@ class XtaRemoteITCase {
...
@@ -87,6 +96,7 @@ class XtaRemoteITCase {
}
}
@Disabled
@DisplayName
(
"should have postfach id"
)
@DisplayName
(
"should have postfach id"
)
@Test
@Test
void
shouldHavePostfachId
()
{
void
shouldHavePostfachId
()
{
...
@@ -109,6 +119,7 @@ class XtaRemoteITCase {
...
@@ -109,6 +119,7 @@ class XtaRemoteITCase {
);
);
}
}
@Disabled
@DisplayName
(
"should have organistationseinheit ID"
)
@DisplayName
(
"should have organistationseinheit ID"
)
@Test
@Test
void
shouldHaveOrganistationseinheitId
()
{
void
shouldHaveOrganistationseinheitId
()
{
...
@@ -124,6 +135,7 @@ class XtaRemoteITCase {
...
@@ -124,6 +135,7 @@ class XtaRemoteITCase {
}
}
@Disabled
@DisplayName
(
"should have vorgang nummer"
)
@DisplayName
(
"should have vorgang nummer"
)
@Test
@Test
void
shouldHaveVorgangNummer
()
{
void
shouldHaveVorgangNummer
()
{
...
@@ -143,21 +155,18 @@ class XtaRemoteITCase {
...
@@ -143,21 +155,18 @@ class XtaRemoteITCase {
return
capturedRequestsFor
(
return
capturedRequestsFor
(
calledMethod
(
VorgangServiceGrpc
.
getStartCreationMethod
())
calledMethod
(
VorgangServiceGrpc
.
getStartCreationMethod
())
)
)
.
getFirst
()
.
stream
()
.
requests
()
.
map
(
CapturedRequest:
:
requests
)
.
stream
().
map
(
GrpcCreateVorgangRequest:
:
getEingang
)
.
flatMap
(
Collection:
:
stream
)
.
map
(
GrpcCreateVorgangRequest:
:
getEingang
)
.
toList
();
.
toList
();
}
}
}
}
@RequiredArgsConstructor
static
class
ActivateXTARunnerConfig
{
static
class
ActivateXTARunnerConfig
{
private
final
XtaService
service
;
private
final
SemantikAdapter
semantikAdapter
;
@Bean
@Bean
XtaRunner
x
taRunner
()
{
XtaRunner
testX
taRunner
()
{
return
new
XtaRunner
(
service
,
semantikAdapter
);
return
new
XtaRunner
();
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
xta-adapter/src/test/resources/application-itcase.yml
+
1
−
1
View file @
7e8dd494
ozgcloud
:
ozgcloud
:
xta
:
xta
:
identifier
:
afmsh:
010600000000_Online-Dienste
identifier
:
afmsh:
ozg-cloud-dev001
server
:
server
:
address
:
localhost:3000
address
:
localhost:3000
name
:
LI33-0005
name
:
LI33-0005
...
...
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