aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv
diff options
context:
space:
mode:
authorChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-05-13 14:02:42 +0200
committerChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-05-13 14:02:42 +0200
commitf4af4f437ff79cb6e2a35fdfe87e8d952a70b685 (patch)
tree4108bf08dab953e11e6ff44233552d73d8ff26e2 /src/main/java/at/gv
parent2f45b2f1366b7152391979c778e36402eb237b03 (diff)
downloadmoa-zs-f4af4f437ff79cb6e2a35fdfe87e8d952a70b685.tar.gz
moa-zs-f4af4f437ff79cb6e2a35fdfe87e8d952a70b685.tar.bz2
moa-zs-f4af4f437ff79cb6e2a35fdfe87e8d952a70b685.zip
Add Unit Tests for DeliveryPipeline
- Refactor: Move TnvzClient in sub package - Autowire all parameters instead of each parameter individually
Diffstat (limited to 'src/main/java/at/gv')
-rw-r--r--src/main/java/at/gv/egiz/moazs/TnvzClient.java2
-rw-r--r--src/main/java/at/gv/egiz/moazs/pipeline/SameThreadDeliveryPipeline.java13
2 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/TnvzClient.java b/src/main/java/at/gv/egiz/moazs/TnvzClient.java
index 7aa6344..4a69aea 100644
--- a/src/main/java/at/gv/egiz/moazs/TnvzClient.java
+++ b/src/main/java/at/gv/egiz/moazs/TnvzClient.java
@@ -1,4 +1,4 @@
-package at.gv.egiz.moazs;
+package at.gv.egiz.moazs.tnvz;
import at.gv.zustellung.app2mzs.xsd.DeliveryRequestType.Sender;
import at.gv.zustellung.app2mzs.xsd.DeliveryRequestType.Receiver;
diff --git a/src/main/java/at/gv/egiz/moazs/pipeline/SameThreadDeliveryPipeline.java b/src/main/java/at/gv/egiz/moazs/pipeline/SameThreadDeliveryPipeline.java
index 7943754..bc80188 100644
--- a/src/main/java/at/gv/egiz/moazs/pipeline/SameThreadDeliveryPipeline.java
+++ b/src/main/java/at/gv/egiz/moazs/pipeline/SameThreadDeliveryPipeline.java
@@ -2,7 +2,7 @@ package at.gv.egiz.moazs.pipeline;
import at.gv.egiz.moazs.MsgClient;
-import at.gv.egiz.moazs.TnvzClient;
+import at.gv.egiz.moazs.tnvz.TnvzClient;
import at.gv.egiz.moazs.repository.DeliveryRepository;
import at.gv.egiz.moazs.scheme.Mzs2MsgConverter;
import at.gv.zustellung.app2mzs.xsd.DeliveryRequestType;
@@ -29,10 +29,11 @@ public class SameThreadDeliveryPipeline implements DeliveryPipeline {
private final Mzs2MsgConverter converter;
private final MsgClient msgClient;
- public SameThreadDeliveryPipeline(@Autowired DeliveryRepository repository,
- @Autowired TnvzClient tnvzClient,
- @Autowired Mzs2MsgConverter converter,
- @Autowired MsgClient msgClient) {
+ @Autowired
+ public SameThreadDeliveryPipeline(DeliveryRepository repository,
+ TnvzClient tnvzClient,
+ Mzs2MsgConverter converter,
+ MsgClient msgClient) {
this.repository = repository;
this.tnvzClient = tnvzClient;
this.converter = converter;
@@ -65,7 +66,7 @@ public class SameThreadDeliveryPipeline implements DeliveryPipeline {
var mismatchedTypes = findMimeTypeMismatches(result, request);
if (!mismatchedTypes.isEmpty()) {
- var template = "Request contains attachment of type(s) %s, but receiver only accepts attachments of type(s) %s";
+ var template = "Request contains attachment of type(s) %s, but receiver only accepts attachments of type(s) %s.";
var acceptedTypesString = join(",", getAcceptedTypes(result));
var mismatchedTypesString = join(",", mismatchedTypes);
throw moaZSException(template, mismatchedTypesString, acceptedTypesString);