Selaa lähdekoodia

CensusEntry Worker added to convertors

Andrew Grant 5 kuukautta sitten
vanhempi
commit
f4bc82440e

+ 1 - 0
src/main/java/scot/carricksoftware/grants/converters/census/CensusEntryCommandConverterImpl.java

@@ -23,6 +23,7 @@ public class CensusEntryCommandConverterImpl implements CensusEntryCommandConver
         result.setRelationship(source.getRelationship());
         result.setCondition(source.getCondition());
         result.setGaelic(source.getGaelic());
+        result.setWorker(source.getWorker());
         return result;
     }
 

+ 1 - 0
src/main/java/scot/carricksoftware/grants/converters/census/CensusEntryConverterImpl.java

@@ -24,6 +24,7 @@ public class CensusEntryConverterImpl implements CensusEntryConverter {
         result.setRelationship(source.getRelationship());
         result.setCondition(source.getCondition());
         result.setGaelic(source.getGaelic());
+        result.setWorker(source.getWorker());
         return result;
     }
 }

+ 4 - 0
src/test/java/scot/carricksoftware/grants/converters/census/CensusEntryCommandConverterTest.java

@@ -15,6 +15,7 @@ import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.enums.censusentry.CensusEntryCondition;
 import scot.carricksoftware.grants.enums.censusentry.CensusEntryGaelic;
 import scot.carricksoftware.grants.enums.censusentry.CensusEntryRelationship;
+import scot.carricksoftware.grants.enums.censusentry.CensusEntryWorker;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static scot.carricksoftware.grants.GenerateCensusEntryRandomEnums.*;
@@ -39,6 +40,7 @@ class CensusEntryCommandConverterTest {
         CensusEntryRelationship relationship = GetRandomCensusEntryRelationship();
         CensusEntryCondition condition = GetRandomCensusEntryCondition();
         CensusEntryGaelic gaelic = GetRandomCensusEntryGaelic();
+        CensusEntryWorker worker = GetRandomCensusEntryWorker();
         CensusEntryCommand source = new CensusEntryCommandImpl();
         Census census = GetRandomCensus();
         Person person = GetRandomPerson();
@@ -51,6 +53,7 @@ class CensusEntryCommandConverterTest {
         source.setRelationship(relationship);
         source.setCondition(condition);
         source.setGaelic(gaelic);
+        source.setWorker(worker);
 
         CensusEntry target = converter.convert(source);
 
@@ -62,5 +65,6 @@ class CensusEntryCommandConverterTest {
         assertEquals(relationship, target.getRelationship());
         assertEquals(condition, target.getCondition());
         assertEquals(gaelic, target.getGaelic());
+        assertEquals(worker, target.getWorker());
     }
 }

+ 4 - 0
src/test/java/scot/carricksoftware/grants/converters/census/CensusEntryConverterTest.java

@@ -14,6 +14,7 @@ import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.enums.censusentry.CensusEntryGaelic;
 import scot.carricksoftware.grants.enums.censusentry.CensusEntryRelationship;
 import scot.carricksoftware.grants.enums.censusentry.CensusEntryCondition;
+import scot.carricksoftware.grants.enums.censusentry.CensusEntryWorker;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static scot.carricksoftware.grants.GenerateCensusEntryRandomEnums.*;
@@ -40,6 +41,7 @@ class CensusEntryConverterTest {
         CensusEntryRelationship relationship = GetRandomCensusEntryRelationship();
         CensusEntryCondition condition = GetRandomCensusEntryCondition();
         CensusEntryGaelic gaelic = GetRandomCensusEntryGaelic();
+        CensusEntryWorker worker = GetRandomCensusEntryWorker();
         Person person = GetRandomPerson();
 
         source.setId(id);
@@ -49,6 +51,7 @@ class CensusEntryConverterTest {
         source.setRelationship(relationship);
         source.setCondition(condition);
         source.setGaelic(gaelic);
+        source.setWorker(worker);
 
         CensusEntryCommand target = converter.convert(source);
 
@@ -60,5 +63,6 @@ class CensusEntryConverterTest {
         assertEquals(relationship, target.getRelationship());
         assertEquals(condition, target.getCondition());
         assertEquals(gaelic, target.getGaelic());
+        assertEquals(worker, target.getWorker());
     }
 }