Răsfoiți Sursa

PersonalOccupation added to census entry

Andrew Grant 7 luni în urmă
părinte
comite
a9899a2ff1

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

@@ -62,4 +62,8 @@ public interface CensusEntryCommand {
     String getBirthYear();
 
     void setBirthYear(String birthYear);
+
+    String getPersonalOccupation();
+
+    void setPersonalOccupation(String personalOccupation);
 }

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

@@ -37,6 +37,8 @@ public class CensusEntryCommandImpl implements CensusEntryCommand {
 
     private String birthYear;
 
+    private String personalOccupation;
+
     public Long getId() {
         return id;
     }
@@ -164,4 +166,14 @@ public class CensusEntryCommandImpl implements CensusEntryCommand {
     public void setBirthYear(String birthYear) {
         this.birthYear = birthYear;
     }
+
+    @Override
+    public String getPersonalOccupation() {
+        return this.personalOccupation;
+    }
+
+    @Override
+    public void setPersonalOccupation(String personalOccupation) {
+        this.personalOccupation = personalOccupation;
+    }
 }

+ 12 - 0
src/test/java/scot/carricksoftware/grants/commands/census/CensusEntryCommandTest.java

@@ -119,4 +119,16 @@ class CensusEntryCommandTest {
         assertEquals(birthYear, command.getBirthYear());
     }
 
+    @Test
+    void getPersonalOccupationTest() {
+        assertNull(command.getPersonalOccupation());
+    }
+
+    @Test
+    void setPersonalOccupationTest() {
+        String personalOccupation = GetRandomString();
+        command.setPersonalOccupation(personalOccupation);
+        assertEquals(personalOccupation, command.getPersonalOccupation());
+    }
+
 }