aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/at/gv
diff options
context:
space:
mode:
authorChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-06-28 09:20:02 +0200
committerChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-06-28 09:20:02 +0200
commit7eb6db5c837db22055b51988031920599a7e7270 (patch)
tree16defb166a7c65aac1bd927be48d6b79de2d2021 /src/test/java/at/gv
parent52306ddf6e786bd1ceaba09cbe37b42778b715fe (diff)
downloadmoa-zs-7eb6db5c837db22055b51988031920599a7e7270.tar.gz
moa-zs-7eb6db5c837db22055b51988031920599a7e7270.tar.bz2
moa-zs-7eb6db5c837db22055b51988031920599a7e7270.zip
Refactor: Deduplicate Code by Simplifying MarshallerConfig
- Move JaxbM initialization into Marshaller such that it can be used in tests without Spring's Application Context. - Remove SpringRunner from Mzs2MsgConverter Test, which makes the test run faster.
Diffstat (limited to 'src/test/java/at/gv')
-rw-r--r--src/test/java/at/gv/egiz/moazs/Mzs2MsgConverterTest.java18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/test/java/at/gv/egiz/moazs/Mzs2MsgConverterTest.java b/src/test/java/at/gv/egiz/moazs/Mzs2MsgConverterTest.java
index de72148..f18ddbe 100644
--- a/src/test/java/at/gv/egiz/moazs/Mzs2MsgConverterTest.java
+++ b/src/test/java/at/gv/egiz/moazs/Mzs2MsgConverterTest.java
@@ -4,13 +4,10 @@ import at.gv.egiz.moazs.scheme.Marshaller;
import at.gv.egiz.moazs.scheme.Mzs2MsgConverter;
import at.gv.zustellung.app2mzs.xsd.DeliveryRequestType;
import at.gv.zustellung.msg.xsd.ObjectFactory;
+import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
import javax.xml.bind.JAXBElement;
import java.io.BufferedInputStream;
@@ -19,23 +16,22 @@ import java.io.IOException;
import static org.assertj.core.api.Assertions.assertThat;
-@RunWith(SpringRunner.class)
-@SpringBootTest
public class Mzs2MsgConverterTest {
private final String basePath = "src/test/resources/at/gv/egiz/moazs/Mzs2MsgConverterTest/";
private final static Logger logger = LoggerFactory.getLogger(Mzs2MsgConverterTest.class);
- @Autowired
private Mzs2MsgConverter converter;
-
- @Autowired
private Marshaller mzsMarshaller;
-
- @Autowired
private Marshaller msgMarshaller;
+ @Before
+ public void setUp() {
+ converter = new Mzs2MsgConverter();
+ mzsMarshaller = new Marshaller(true);
+ msgMarshaller = new Marshaller(false);
+ }
@Test
public void testCanConvertValidMzsRequestToMsgRequest() throws IOException {