diff --git a/jee7/pom.xml b/jee7/pom.xml index ebe9b6aee9..66991d03a8 100644 --- a/jee7/pom.xml +++ b/jee7/pom.xml @@ -1,320 +1,335 @@ - - 4.0.0 + + 4.0.0 - com.baeldung - jee7schedule - 1.0-SNAPSHOT - JavaEE 7 Arquillian Archetype Sample - war + com.baeldung + jee7schedule + 1.0-SNAPSHOT + JavaEE 7 Arquillian Archetype Sample + war - - 1.7 - 3.0.0 + + 1.7 + 3.0.0 - 4.12 - 7.0 - 1.1.11.Final - 8.2.1.Final - 1.7.0 - 1.4.6.Final - 3.0.19.Final - 4.1.1 - 1.0.4 - 1.13 - 2.25 - 1.0.0.Final - - 3.6.0 - 2.6 - + 4.12 + 7.0 + 1.1.11.Final + 8.2.1.Final + 1.7.0 + 1.4.6.Final + 3.0.19.Final + 4.1.1 + 1.0.4 + 1.13 + 2.25 + 1.0.0.Final - - ${maven.min.version} - + 3.6.0 + 2.6 + - - - - org.jboss.arquillian - arquillian-bom - ${arquillian_core.version} - import - pom - - - + + ${maven.min.version} + - - - javax - javaee-api - ${javaee_api.version} - provided - - - - junit - junit - ${junit.version} - test - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - com.jayway.awaitility - awaitility - ${awaitility.version} - test - - - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven - test - jar - - - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven-archive - test - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.min.version} - ${java.min.version} - - - - org.apache.maven.plugins - maven-war-plugin - ${maven-war-plugin.version} - - false - - - - - - - - - wildfly-managed-arquillian - - true - - - standalone-full.xml - ${project.build.directory}/wildfly-${version.wildfly} - - + + - io.undertow - undertow-websockets-jsr - ${undertow-websockets-jsr.version} - test + org.jboss.arquillian + arquillian-bom + ${arquillian_core.version} + import + pom - - org.jboss.resteasy - resteasy-client - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-jaxb-provider - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-json-p-provider - ${resteasy.version} - test - - - org.wildfly - wildfly-arquillian-container-managed - ${wildfly.version} - test - - - - - - maven-dependency-plugin - 2.8 - - ${maven.test.skip} - - - - unpack - process-test-classes - - unpack - + + + + + + javax + javaee-api + ${javaee_api.version} + provided + + + + junit + junit + ${junit.version} + test + + + org.jboss.arquillian.junit + arquillian-junit-container + test + + + com.jayway.awaitility + awaitility + ${awaitility.version} + test + + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven + test + jar + + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven-archive + test + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.min.version} + ${java.min.version} + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + **/*IntegrationTest.java + **/*LongRunningUnitTest.java + **/*ManualTest.java + + + + + + + + + + wildfly-managed-arquillian + + true + + + standalone-full.xml + ${project.build.directory}/wildfly-${version.wildfly} + + + + io.undertow + undertow-websockets-jsr + ${undertow-websockets-jsr.version} + test + + + org.jboss.resteasy + resteasy-client + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-jaxb-provider + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-json-p-provider + ${resteasy.version} + test + + + org.wildfly + wildfly-arquillian-container-managed + ${wildfly.version} + test + + + + + + maven-dependency-plugin + 2.8 - - - org.wildfly - wildfly-dist - ${wildfly.version} - zip - false - ${project.build.directory} - - + ${maven.test.skip} - - - - - maven-surefire-plugin - 2.17 - - - ${project.build.directory}/wildfly-${wildfly.version} - - - - - - - - wildfly-remote-arquillian - - - io.undertow - undertow-websockets-jsr - ${undertow-websockets-jsr.version} - test - - - org.jboss.resteasy - resteasy-client - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-jaxb-provider - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-json-p-provider - ${resteasy.version} - test - - - org.wildfly - wildfly-arquillian-container-remote - ${wildfly.version} - test - - - - - glassfish-embedded-arquillian - - - org.glassfish.main.extras - glassfish-embedded-all - ${glassfish-embedded-all.version} - test - - - org.glassfish - javax.json - ${javax.json.version} - test - - - org.glassfish.tyrus - tyrus-client - ${tyrus.version} - test - - - org.glassfish.tyrus - tyrus-container-grizzly-client - ${tyrus.version} - test - - - org.glassfish.jersey.core - jersey-client - ${jersey.version} - test - - - org.jboss.arquillian.container - arquillian-glassfish-embedded-3.1 - ${arquillian-glassfish.version} - test - - - - - glassfish-remote-arquillian - - - org.glassfish - javax.json - ${javax.json.version} - test - - - org.glassfish.tyrus - tyrus-client - ${tyrus.version} - test - - - org.glassfish.tyrus - tyrus-container-grizzly-client - ${tyrus.version} - test - - - org.glassfish.jersey.core - jersey-client - ${jersey.version} - test - - - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey.version} - test - - - org.glassfish.jersey.media - jersey-media-json-processing - ${jersey.version} - test - - - org.jboss.arquillian.container - arquillian-glassfish-remote-3.1 - ${arquillian-glassfish.version} - test - - - - + + + unpack + process-test-classes + + unpack + + + + + org.wildfly + wildfly-dist + ${wildfly.version} + zip + false + ${project.build.directory} + + + + + + + + maven-surefire-plugin + 2.17 + + + ${project.build.directory}/wildfly-${wildfly.version} + + + + + + + + wildfly-remote-arquillian + + + io.undertow + undertow-websockets-jsr + ${undertow-websockets-jsr.version} + test + + + org.jboss.resteasy + resteasy-client + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-jaxb-provider + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-json-p-provider + ${resteasy.version} + test + + + org.wildfly + wildfly-arquillian-container-remote + ${wildfly.version} + test + + + + + glassfish-embedded-arquillian + + + org.glassfish.main.extras + glassfish-embedded-all + ${glassfish-embedded-all.version} + test + + + org.glassfish + javax.json + ${javax.json.version} + test + + + org.glassfish.tyrus + tyrus-client + ${tyrus.version} + test + + + org.glassfish.tyrus + tyrus-container-grizzly-client + ${tyrus.version} + test + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + test + + + org.jboss.arquillian.container + arquillian-glassfish-embedded-3.1 + ${arquillian-glassfish.version} + test + + + + + glassfish-remote-arquillian + + + org.glassfish + javax.json + ${javax.json.version} + test + + + org.glassfish.tyrus + tyrus-client + ${tyrus.version} + test + + + org.glassfish.tyrus + tyrus-container-grizzly-client + ${tyrus.version} + test + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + test + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey.version} + test + + + org.glassfish.jersey.media + jersey-media-json-processing + ${jersey.version} + test + + + org.jboss.arquillian.container + arquillian-glassfish-remote-3.1 + ${arquillian-glassfish.version} + test + + + + diff --git a/jee7/src/test/java/com/baeldung/timer/AutomaticTimerBeanTest.java b/jee7/src/test/java/com/baeldung/timer/AutomaticTimerBeanIntegrationTest.java similarity index 98% rename from jee7/src/test/java/com/baeldung/timer/AutomaticTimerBeanTest.java rename to jee7/src/test/java/com/baeldung/timer/AutomaticTimerBeanIntegrationTest.java index df922b28df..0e4c91ad67 100644 --- a/jee7/src/test/java/com/baeldung/timer/AutomaticTimerBeanTest.java +++ b/jee7/src/test/java/com/baeldung/timer/AutomaticTimerBeanIntegrationTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.equalTo; @RunWith(Arquillian.class) -public class AutomaticTimerBeanTest { +public class AutomaticTimerBeanIntegrationTest { //the @AutomaticTimerBean has a method called every 10 seconds //testing the difference ==> 100000 diff --git a/jee7/src/test/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBeanTest.java b/jee7/src/test/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBeanIntegrationTest.java similarity index 96% rename from jee7/src/test/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBeanTest.java rename to jee7/src/test/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBeanIntegrationTest.java index 76c0e3e5b8..13cd1729db 100644 --- a/jee7/src/test/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBeanTest.java +++ b/jee7/src/test/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBeanIntegrationTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.is; @RunWith(Arquillian.class) -public class ProgrammaticAtFixedRateTimerBeanTest { +public class ProgrammaticAtFixedRateTimerBeanIntegrationTest { final static long TIMEOUT = 1000; final static long TOLERANCE = 500l; diff --git a/jee7/src/test/java/com/baeldung/timer/ProgrammaticTimerBeanTest.java b/jee7/src/test/java/com/baeldung/timer/ProgrammaticTimerBeanIntegrationTest.java similarity index 97% rename from jee7/src/test/java/com/baeldung/timer/ProgrammaticTimerBeanTest.java rename to jee7/src/test/java/com/baeldung/timer/ProgrammaticTimerBeanIntegrationTest.java index f93ba61fe3..b90cb6d909 100644 --- a/jee7/src/test/java/com/baeldung/timer/ProgrammaticTimerBeanTest.java +++ b/jee7/src/test/java/com/baeldung/timer/ProgrammaticTimerBeanIntegrationTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.is; @RunWith(Arquillian.class) -public class ProgrammaticTimerBeanTest { +public class ProgrammaticTimerBeanIntegrationTest { final static long TIMEOUT = 5000l; final static long TOLERANCE = 1000l; diff --git a/jee7/src/test/java/com/baeldung/timer/ProgrammaticWithFixedDelayTimerBeanTest.java b/jee7/src/test/java/com/baeldung/timer/ProgrammaticWithFixedDelayTimerBeanIntegrationTest.java similarity index 97% rename from jee7/src/test/java/com/baeldung/timer/ProgrammaticWithFixedDelayTimerBeanTest.java rename to jee7/src/test/java/com/baeldung/timer/ProgrammaticWithFixedDelayTimerBeanIntegrationTest.java index 6764aa386d..e2e660f79b 100644 --- a/jee7/src/test/java/com/baeldung/timer/ProgrammaticWithFixedDelayTimerBeanTest.java +++ b/jee7/src/test/java/com/baeldung/timer/ProgrammaticWithFixedDelayTimerBeanIntegrationTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.is; @RunWith(Arquillian.class) -public class ProgrammaticWithFixedDelayTimerBeanTest { +public class ProgrammaticWithFixedDelayTimerBeanIntegrationTest { final static long TIMEOUT = 15000l; final static long TOLERANCE = 1000l; diff --git a/jee7/src/test/java/com/baeldung/timer/ScheduleTimerBeanTest.java b/jee7/src/test/java/com/baeldung/timer/ScheduleTimerBeanIntegrationTest.java similarity index 97% rename from jee7/src/test/java/com/baeldung/timer/ScheduleTimerBeanTest.java rename to jee7/src/test/java/com/baeldung/timer/ScheduleTimerBeanIntegrationTest.java index 7a5b043101..c3c5ad44de 100644 --- a/jee7/src/test/java/com/baeldung/timer/ScheduleTimerBeanTest.java +++ b/jee7/src/test/java/com/baeldung/timer/ScheduleTimerBeanIntegrationTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.Matchers.equalTo; @RunWith(Arquillian.class) -public class ScheduleTimerBeanTest { +public class ScheduleTimerBeanIntegrationTest { final static long TIMEOUT = 5000l; final static long TOLERANCE = 1000l; diff --git a/orika/pom.xml b/orika/pom.xml index 94efbc77f3..e8ef696301 100644 --- a/orika/pom.xml +++ b/orika/pom.xml @@ -14,7 +14,7 @@ 3.6.0 - Orika + orika diff --git a/orika/src/test/java/com/baeldung/orika/OrikaTest.java b/orika/src/test/java/com/baeldung/orika/OrikaTest.java index 18dfcfa44e..f7f14a5f2d 100644 --- a/orika/src/test/java/com/baeldung/orika/OrikaTest.java +++ b/orika/src/test/java/com/baeldung/orika/OrikaTest.java @@ -4,31 +4,31 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.Arrays; -import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.junit.Before; +import org.junit.Test; + import ma.glasnost.orika.BoundMapperFacade; import ma.glasnost.orika.CustomMapper; import ma.glasnost.orika.MapperFacade; import ma.glasnost.orika.MapperFactory; -import ma.glasnost.orika.MappingContext; import ma.glasnost.orika.impl.DefaultMapperFactory; -import org.junit.Before; -import org.junit.Test; - public class OrikaTest { + MapperFactory mapperFactory; + CustomMapper customMapper; + // constant to help us cover time zone differences private final long GMT_DIFFERENCE = 46800000; + // + @Before public void before() { mapperFactory = new DefaultMapperFactory.Builder().build(); @@ -68,8 +68,7 @@ public class OrikaTest { @Test public void givenSrcAndDest_whenMapsUsingBoundMapper_thenCorrect() { - BoundMapperFacade boundMapper = mapperFactory - .getMapperFacade(Source.class, Dest.class); + BoundMapperFacade boundMapper = mapperFactory.getMapperFacade(Source.class, Dest.class); Source src = new Source("baeldung", 10); Dest dest = boundMapper.map(src); assertEquals(dest.getAge(), src.getAge()); @@ -78,8 +77,7 @@ public class OrikaTest { @Test public void givenSrcAndDest_whenMapsUsingBoundMapperInReverse_thenCorrect() { - BoundMapperFacade boundMapper = mapperFactory - .getMapperFacade(Source.class, Dest.class); + BoundMapperFacade boundMapper = mapperFactory.getMapperFacade(Source.class, Dest.class); Dest src = new Dest("baeldung", 10); Source dest = boundMapper.mapReverse(src); assertEquals(dest.getAge(), src.getAge()); @@ -88,8 +86,7 @@ public class OrikaTest { @Test public void givenSrcAndDest_whenMapsUsingBoundMapperByObject_thenCorrect() { - BoundMapperFacade boundMapper = mapperFactory - .getMapperFacade(Source.class, Dest.class); + BoundMapperFacade boundMapper = mapperFactory.getMapperFacade(Source.class, Dest.class); Source src = new Source("baeldung", 10); Dest dest = new Dest(); boundMapper.map(src, dest); @@ -99,8 +96,7 @@ public class OrikaTest { @Test public void givenSrcAndDest_whenMapsUsingBoundMapperByObjectInReverse_thenCorrect() { - BoundMapperFacade boundMapper = mapperFactory - .getMapperFacade(Source.class, Dest.class); + BoundMapperFacade boundMapper = mapperFactory.getMapperFacade(Source.class, Dest.class); Dest src = new Dest("baeldung", 10); Source dest = new Source(); boundMapper.mapReverse(src, dest); @@ -110,9 +106,7 @@ public class OrikaTest { @Test public void givenSrcAndDestWithDifferentFieldNames_whenMaps_thenCorrect() { - mapperFactory.classMap(Personne.class, Person.class) - .field("nom", "name").field("surnom", "nickname") - .field("age", "age").register(); + mapperFactory.classMap(Personne.class, Person.class).field("nom", "name").field("surnom", "nickname").field("age", "age").register(); MapperFacade mapper = mapperFactory.getMapperFacade(); @@ -127,8 +121,7 @@ public class OrikaTest { @Test public void givenBothDifferentAndSameFieldNames_whenFailsToMapSameNameFieldAutomatically_thenCorrect() { - mapperFactory.classMap(Personne.class, Person.class) - .field("nom", "name").field("surnom", "nickname").register(); + mapperFactory.classMap(Personne.class, Person.class).field("nom", "name").field("surnom", "nickname").register(); MapperFacade mapper = mapperFactory.getMapperFacade(); Personne frenchPerson = new Personne("Claire", "cla", 25); @@ -139,9 +132,7 @@ public class OrikaTest { @Test public void givenBothDifferentAndSameFieldNames_whenMapsSameNameFieldByDefault_thenCorrect() { - mapperFactory.classMap(Personne.class, Person.class) - .field("nom", "name").field("surnom", "nickname").byDefault() - .register(); + mapperFactory.classMap(Personne.class, Person.class).field("nom", "name").field("surnom", "nickname").byDefault().register(); MapperFacade mapper = mapperFactory.getMapperFacade(); Personne frenchPerson = new Personne("Claire", "cla", 25); @@ -155,9 +146,7 @@ public class OrikaTest { @Test public void givenUnidirectionalMappingSetup_whenMapsUnidirectionally_thenCorrect() { - mapperFactory.classMap(Personne.class, Person.class) - .fieldAToB("nom", "name").fieldAToB("surnom", "nickname") - .fieldAToB("age", "age").register(); + mapperFactory.classMap(Personne.class, Person.class).fieldAToB("nom", "name").fieldAToB("surnom", "nickname").fieldAToB("age", "age").register(); ; MapperFacade mapper = mapperFactory.getMapperFacade(); Personne frenchPerson = new Personne("Claire", "cla", 25); @@ -169,11 +158,9 @@ public class OrikaTest { } - @Test public void givenSrcAndDest_whenCanExcludeField_thenCorrect() { - mapperFactory.classMap(Personne.class, Person.class).exclude("nom") - .field("surnom", "nickname").field("age", "age").register(); + mapperFactory.classMap(Personne.class, Person.class).exclude("nom").field("surnom", "nickname").field("age", "age").register(); MapperFacade mapper = mapperFactory.getMapperFacade(); Personne frenchPerson = new Personne("Claire", "cla", 25); @@ -186,9 +173,7 @@ public class OrikaTest { @Test public void givenSpecificConstructorToUse_whenMaps_thenCorrect() { - mapperFactory.classMap(Personne.class, Person.class).constructorB() - .field("nom", "name").field("surnom", "nickname") - .field("age", "age").register(); + mapperFactory.classMap(Personne.class, Person.class).constructorB().field("nom", "name").field("surnom", "nickname").field("age", "age").register(); ; MapperFacade mapper = mapperFactory.getMapperFacade(); Personne frenchPerson = new Personne("Claire", "cla", 25); @@ -202,12 +187,9 @@ public class OrikaTest { @Test public void givenSrcWithListAndDestWithPrimitiveAttributes_whenMaps_thenCorrect() { - mapperFactory.classMap(PersonNameList.class, PersonNameParts.class) - .field("nameList[0]", "firstName") - .field("nameList[1]", "lastName").register(); + mapperFactory.classMap(PersonNameList.class, PersonNameParts.class).field("nameList[0]", "firstName").field("nameList[1]", "lastName").register(); MapperFacade mapper = mapperFactory.getMapperFacade(); - List nameList = Arrays.asList(new String[]{"Sylvester", - "Stallone"}); + List nameList = Arrays.asList(new String[] { "Sylvester", "Stallone" }); PersonNameList src = new PersonNameList(nameList); PersonNameParts dest = mapper.map(src, PersonNameParts.class); assertEquals(dest.getFirstName(), "Sylvester"); @@ -216,11 +198,9 @@ public class OrikaTest { @Test public void givenSrcWithArrayAndDestWithPrimitiveAttributes_whenMaps_thenCorrect() { - mapperFactory.classMap(PersonNameArray.class, PersonNameParts.class) - .field("nameArray[0]", "firstName") - .field("nameArray[1]", "lastName").register(); + mapperFactory.classMap(PersonNameArray.class, PersonNameParts.class).field("nameArray[0]", "firstName").field("nameArray[1]", "lastName").register(); MapperFacade mapper = mapperFactory.getMapperFacade(); - String[] nameArray = new String[]{"Vin", "Diesel"}; + String[] nameArray = new String[] { "Vin", "Diesel" }; PersonNameArray src = new PersonNameArray(nameArray); PersonNameParts dest = mapper.map(src, PersonNameParts.class); assertEquals(dest.getFirstName(), "Vin"); @@ -229,9 +209,7 @@ public class OrikaTest { @Test public void givenSrcWithMapAndDestWithPrimitiveAttributes_whenMaps_thenCorrect() { - mapperFactory.classMap(PersonNameMap.class, PersonNameParts.class) - .field("nameMap['first']", "firstName") - .field("nameMap[\"last\"]", "lastName").register(); + mapperFactory.classMap(PersonNameMap.class, PersonNameParts.class).field("nameMap['first']", "firstName").field("nameMap[\"last\"]", "lastName").register(); MapperFacade mapper = mapperFactory.getMapperFacade(); Map nameMap = new HashMap<>(); nameMap.put("first", "Leornado"); @@ -244,9 +222,7 @@ public class OrikaTest { @Test public void givenSrcWithNestedFields_whenMaps_thenCorrect() { - mapperFactory.classMap(PersonContainer.class, PersonNameParts.class) - .field("name.firstName", "firstName") - .field("name.lastName", "lastName").register(); + mapperFactory.classMap(PersonContainer.class, PersonNameParts.class).field("name.firstName", "firstName").field("name.lastName", "lastName").register(); MapperFacade mapper = mapperFactory.getMapperFacade(); PersonContainer src = new PersonContainer(new Name("Nick", "Canon")); PersonNameParts dest = mapper.map(src, PersonNameParts.class); @@ -266,8 +242,7 @@ public class OrikaTest { @Test public void givenSrcWithNullAndGlobalConfigForNoNull_whenFailsToMap_ThenCorrect() { - MapperFactory mapperFactory = new DefaultMapperFactory.Builder() - .mapNulls(false).build(); + MapperFactory mapperFactory = new DefaultMapperFactory.Builder().mapNulls(false).build(); mapperFactory.classMap(Source.class, Dest.class); MapperFacade mapper = mapperFactory.getMapperFacade(); Source src = new Source(null, 10); @@ -279,8 +254,7 @@ public class OrikaTest { @Test public void givenSrcWithNullAndLocalConfigForNoNull_whenFailsToMap_ThenCorrect() { - mapperFactory.classMap(Source.class, Dest.class).field("age", "age") - .mapNulls(false).field("name", "name").byDefault().register(); + mapperFactory.classMap(Source.class, Dest.class).field("age", "age").mapNulls(false).field("name", "name").byDefault().register(); MapperFacade mapper = mapperFactory.getMapperFacade(); Source src = new Source(null, 10); Dest dest = new Dest("Clinton", 55); @@ -302,9 +276,7 @@ public class OrikaTest { @Test public void givenDestWithNullReverseMappedToSourceAndLocalConfigForNoNull_whenFailsToMap_thenCorrect() { - mapperFactory.classMap(Source.class, Dest.class).field("age", "age") - .mapNullsInReverse(false).field("name", "name").byDefault() - .register(); + mapperFactory.classMap(Source.class, Dest.class).field("age", "age").mapNullsInReverse(false).field("name", "name").byDefault().register(); MapperFacade mapper = mapperFactory.getMapperFacade(); Dest src = new Dest(null, 10); Source dest = new Source("Vin", 44); @@ -315,9 +287,7 @@ public class OrikaTest { @Test public void givenSrcWithNullAndFieldLevelConfigForNoNull_whenFailsToMap_ThenCorrect() { - mapperFactory.classMap(Source.class, Dest.class).field("age", "age") - .fieldMap("name", "name").mapNulls(false).add().byDefault() - .register(); + mapperFactory.classMap(Source.class, Dest.class).field("age", "age").fieldMap("name", "name").mapNulls(false).add().byDefault().register(); MapperFacade mapper = mapperFactory.getMapperFacade(); Source src = new Source(null, 10); Dest dest = new Dest("Clinton", 55); @@ -328,8 +298,7 @@ public class OrikaTest { @Test public void givenSrcAndDest_whenCustomMapperWorks_thenCorrect() { - mapperFactory.classMap(Personne3.class, Person3.class) - .customize(customMapper).register(); + mapperFactory.classMap(Personne3.class, Person3.class).customize(customMapper).register(); MapperFacade mapper = mapperFactory.getMapperFacade(); long timestamp = new Long("1182882159000"); Personne3 personne3 = new Personne3("Leornardo", timestamp); @@ -339,14 +308,12 @@ public class OrikaTest { // since different timezones will resolve the timestamp to a different // datetime string, it suffices to check only for format rather than // specific date - assertTrue(timestampTest.charAt(10) == 'T' - && timestampTest.charAt(19) == 'Z'); + assertTrue(timestampTest.charAt(10) == 'T' && timestampTest.charAt(19) == 'Z'); } @Test public void givenSrcAndDest_whenCustomMapperWorksBidirectionally_thenCorrect() { - mapperFactory.classMap(Personne3.class, Person3.class) - .customize(customMapper).register(); + mapperFactory.classMap(Personne3.class, Person3.class).customize(customMapper).register(); MapperFacade mapper = mapperFactory.getMapperFacade(); String dateTime = "2007-06-26T21:22:39Z"; @@ -355,12 +322,10 @@ public class OrikaTest { Personne3 personne3 = mapper.map(person3, Personne3.class); long timestampToTest = personne3.getDtob(); /* - * since different timezones will resolve the datetime to a different - * unix timestamp, we must provide a range of tolerance - */ - assertTrue(timestampToTest == timestamp - || timestampToTest >= timestamp - GMT_DIFFERENCE - || timestampToTest <= timestamp + GMT_DIFFERENCE); + * since different timezones will resolve the datetime to a different + * unix timestamp, we must provide a range of tolerance + */ + assertTrue(timestampToTest == timestamp || timestampToTest >= timestamp - GMT_DIFFERENCE || timestampToTest <= timestamp + GMT_DIFFERENCE); }