Browse Source

PersonalOccupation added to census entry converters

Andrew Grant 7 months ago
parent
commit
755e8a2a89

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

@@ -29,6 +29,7 @@ public class CensusEntryCommandConverterImpl implements CensusEntryCommandConver
         result.setSex(source.getSex());
         result.setBirthYear(source.getBirthYear());
         result.setBirthDay(source.getBirthDay());
+        result.setPersonalOccupation(source.getPersonalOccupation());
         return result;
     }
 

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

@@ -30,6 +30,7 @@ public class CensusEntryConverterImpl implements CensusEntryConverter {
         result.setSex(source.getSex());
         result.setBirthYear(source.getBirthYear());
         result.setBirthDay(source.getBirthDay());
+        result.setPersonalOccupation(source.getPersonalOccupation());
         return result;
     }
 }

+ 1 - 1
src/main/resources/application.properties

@@ -2,7 +2,7 @@ spring.application.name=grants
 server.port=8086
 server.servlet.context-path=/grants
 spring.mvc.format.date=dd-MM-yyyy
-spring.profiles.active=uat
+spring.profiles.active=dev
 logging.level.scot.carricksoftware=debug
 
 

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

@@ -46,6 +46,7 @@ class CensusEntryCommandConverterTest {
         CensusEntrySex sex = GetRandomCensusEntrySex();
         String birthYear = GetRandomString();
         String birthDay = GetRandomString();
+        String personalOccupation = GetRandomString();
 
 
         source.setId(id);
@@ -61,6 +62,7 @@ class CensusEntryCommandConverterTest {
         source.setSex(sex);
         source.setBirthYear(birthYear);
         source.setBirthDay(birthDay);
+        source.setPersonalOccupation(personalOccupation);
 
         CensusEntry target = converter.convert(source);
 
@@ -78,5 +80,6 @@ class CensusEntryCommandConverterTest {
         assertEquals(sex, target.getSex());
         assertEquals(birthYear, target.getBirthYear());
         assertEquals(birthDay, target.getBirthDay());
+        assertEquals(personalOccupation, target.getPersonalOccupation());
     }
 }

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

@@ -45,6 +45,7 @@ class CensusEntryConverterTest {
         CensusEntrySex sex = GetRandomCensusEntrySex();
         String birthYear = GetRandomString();
         String birthDay = GetRandomString();
+        String personalOccupation = GetRandomString();
 
         source.setId(id);
         source.setName(name);
@@ -59,6 +60,7 @@ class CensusEntryConverterTest {
         source.setSex(sex);
         source.setBirthYear(birthYear);
         source.setBirthDay(birthDay);
+        source.setPersonalOccupation(personalOccupation);
 
         CensusEntryCommand target = converter.convert(source);
 
@@ -76,5 +78,6 @@ class CensusEntryConverterTest {
         assertEquals(sex, target.getSex());
         assertEquals(birthYear, target.getBirthYear());
         assertEquals(birthDay, target.getBirthDay());
+        assertEquals(personalOccupation, target.getPersonalOccupation());
     }
 }