From f4af4f437ff79cb6e2a35fdfe87e8d952a70b685 Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Mon, 13 May 2019 14:02:42 +0200 Subject: Add Unit Tests for DeliveryPipeline - Refactor: Move TnvzClient in sub package - Autowire all parameters instead of each parameter individually --- src/main/java/at/gv/egiz/moazs/TnvzClient.java | 2 +- .../gv/egiz/moazs/pipeline/SameThreadDeliveryPipeline.java | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src/main') 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); -- cgit v1.2.3