aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/at
diff options
context:
space:
mode:
authorChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-11-29 15:56:44 +0100
committerChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-11-29 15:56:44 +0100
commit6dbe979e0b6bd6236db304b034ad592a4aeacabc (patch)
tree4c5c10279b01e3602da8195c741191f660561e9b /src/test/java/at
parenta5b8668c0c7916a8fe2b84122d537a3e0bd67002 (diff)
downloadmoa-zs-6dbe979e0b6bd6236db304b034ad592a4aeacabc.tar.gz
moa-zs-6dbe979e0b6bd6236db304b034ad592a4aeacabc.tar.bz2
moa-zs-6dbe979e0b6bd6236db304b034ad592a4aeacabc.zip
Refactor & Fix Client Creation in Client Factory
- Refactor: Replace createSoap1{1,2} with create{Tnvz,App,Msg}Client. Configure each method with zusespec's specific parameters. Reason: Each service requires different parameters (e.g. with / without MTOM? soap11 / soap12? store responses in binary respository - yes/no?). These parameters could be placed in the client configuration of application.yaml. Since the parameters are tied to zusespecs, they do not need to be configurable via application.yaml. Another benefit for this refactoring is to improve readability. - Fix: Disable "Store Response" for TNVZ Client and App Client
Diffstat (limited to 'src/test/java/at')
-rw-r--r--src/test/java/at/gv/egiz/moazs/DeliveryRequestBackendTest.java4
-rw-r--r--src/test/java/at/gv/egiz/moazs/ITEndToEndTest.java6
-rw-r--r--src/test/java/at/gv/egiz/moazs/ITSSLMsgClientTest.java2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/test/java/at/gv/egiz/moazs/DeliveryRequestBackendTest.java b/src/test/java/at/gv/egiz/moazs/DeliveryRequestBackendTest.java
index e1859b5..f2e33ab 100644
--- a/src/test/java/at/gv/egiz/moazs/DeliveryRequestBackendTest.java
+++ b/src/test/java/at/gv/egiz/moazs/DeliveryRequestBackendTest.java
@@ -165,11 +165,11 @@ public class DeliveryRequestBackendTest {
when(converter.convert(eq(mzsRequest) )).thenReturn(msgRequest);
when(converter.convert(eq(mzsRequest), any())).thenReturn(msgRequest);
- when(clientFactory.createSOAP12(any(), same(App2ZusePort.class))).thenReturn(msgClient);
+ when(clientFactory.createMsgClient(any())).thenReturn(msgClient);
when(msgClient.delivery(msgRequest)).thenReturn(status);
if (tnvzRequest) {
- when(clientFactory.createSOAP12(any(), same(TNVZServicePort.class))).thenReturn(tnvzClient);
+ when(clientFactory.createTnvzClient(any())).thenReturn(tnvzClient);
when(tnvzHelper.performQueryPersonRequest(any(), any())).thenReturn(identification);
}
return status;
diff --git a/src/test/java/at/gv/egiz/moazs/ITEndToEndTest.java b/src/test/java/at/gv/egiz/moazs/ITEndToEndTest.java
index 7e03a13..f350681 100644
--- a/src/test/java/at/gv/egiz/moazs/ITEndToEndTest.java
+++ b/src/test/java/at/gv/egiz/moazs/ITEndToEndTest.java
@@ -112,9 +112,9 @@ public class ITEndToEndTest {
var tnvz = mockTnvz();
var msg = mockMsg();
APP = mockApp();
- when(factory.createSOAP12(any(), same(TNVZServicePort.class))).thenReturn(tnvz);
- when(factory.createSOAP12(any(), same(App2ZusePort.class))).thenReturn(msg);
- when(factory.createSOAP11(any(), same(Mzs2AppPortType.class))).thenReturn(APP);
+ when(factory.createTnvzClient(any())).thenReturn(tnvz);
+ when(factory.createMsgClient(any())).thenReturn(msg);
+ when(factory.createAppClient(any())).thenReturn(APP);
return factory;
}
diff --git a/src/test/java/at/gv/egiz/moazs/ITSSLMsgClientTest.java b/src/test/java/at/gv/egiz/moazs/ITSSLMsgClientTest.java
index 107ede5..4158aec 100644
--- a/src/test/java/at/gv/egiz/moazs/ITSSLMsgClientTest.java
+++ b/src/test/java/at/gv/egiz/moazs/ITSSLMsgClientTest.java
@@ -86,7 +86,7 @@ public class ITSSLMsgClientTest {
}
private App2ZusePort createPort(ClientType params) {
- return factory.createSOAP12(params, App2ZusePort.class);
+ return factory.createMsgClient(params);
}
// Requirements: