Bladeren bron

CensusEntry Worker added to command

Andrew Grant 5 maanden geleden
bovenliggende
commit
bb7c00d50c

+ 5 - 0
src/main/java/scot/carricksoftware/grants/commands/census/CensusEntryCommand.java

@@ -10,6 +10,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;
 
 public interface CensusEntryCommand {
 
@@ -40,4 +41,8 @@ public interface CensusEntryCommand {
     CensusEntryGaelic getGaelic();
 
     void setGaelic(CensusEntryGaelic gaelic);
+
+    CensusEntryWorker getWorker();
+
+    void setWorker(CensusEntryWorker worker);
 }

+ 13 - 0
src/main/java/scot/carricksoftware/grants/commands/census/CensusEntryCommandImpl.java

@@ -10,6 +10,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;
 
 public class CensusEntryCommandImpl implements CensusEntryCommand {
 
@@ -27,6 +28,8 @@ public class CensusEntryCommandImpl implements CensusEntryCommand {
 
     private CensusEntryGaelic gaelic;
 
+    private CensusEntryWorker worker;
+
     public Long getId() {
         return id;
     }
@@ -94,4 +97,14 @@ public class CensusEntryCommandImpl implements CensusEntryCommand {
     public void setGaelic(CensusEntryGaelic gaelic) {
         this.gaelic = gaelic;
     }
+
+    @Override
+    public CensusEntryWorker getWorker() {
+        return worker;
+    }
+
+    @Override
+    public void setWorker(CensusEntryWorker worker) {
+        this.worker = worker;
+    }
 }

+ 13 - 0
src/test/java/scot/carricksoftware/grants/commands/census/CensusEntryCommandEnumTest.java

@@ -11,6 +11,7 @@ import org.junit.jupiter.api.Test;
 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 org.junit.jupiter.api.Assertions.assertNull;
@@ -61,4 +62,16 @@ class CensusEntryCommandEnumTest {
         assertEquals(gaelic, command.getGaelic());
     }
 
+    @Test
+    void getWorkerTest() {
+        assertNull(command.getWorker());
+    }
+
+    @Test
+    void setWorkerTest() {
+        CensusEntryWorker worker = GetRandomCensusEntryWorker();
+        command.setWorker(worker);
+        assertEquals(worker, command.getWorker());
+    }
+    
 }