Эх сурвалжийг харах

Move Sex enum to general
Fixes #58

Andrew Grant 6 сар өмнө
parent
commit
a6d4e3838a
26 өөрчлөгдсөн 62 нэмэгдсэн , 52 устгасан
  1. 2 1
      src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadCensus.java
  2. 2 2
      src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadCertificates.java
  3. 3 2
      src/main/java/scot/carricksoftware/grants/commands/census/CensusEntryCommand.java
  4. 4 3
      src/main/java/scot/carricksoftware/grants/commands/census/CensusEntryCommandImpl.java
  5. 3 3
      src/main/java/scot/carricksoftware/grants/commands/certificates/birthcertificates/BirthCertificateCommand.java
  6. 4 4
      src/main/java/scot/carricksoftware/grants/commands/certificates/birthcertificates/BirthCertificateCommandImpl.java
  7. 4 3
      src/main/java/scot/carricksoftware/grants/domains/census/CensusEntry.java
  8. 4 4
      src/main/java/scot/carricksoftware/grants/domains/certificates/BirthCertificate.java
  9. 3 3
      src/main/java/scot/carricksoftware/grants/enums/general/Sex.java
  10. 2 2
      src/main/java/scot/carricksoftware/grants/validators/helpers/ValidateTypes.java
  11. 2 2
      src/main/java/scot/carricksoftware/grants/validators/helpers/ValidateTypesImpl.java
  12. 1 1
      src/main/resources/templates/censusEntry/form.html
  13. 1 1
      src/main/resources/templates/certificates/birthCertificate/form.html
  14. 3 2
      src/test/java/scot/carricksoftware/grants/GenerateCensusEntryRandomEnums.java
  15. 2 1
      src/test/java/scot/carricksoftware/grants/bootstrap/DataLoadCensusTest.java
  16. 2 2
      src/test/java/scot/carricksoftware/grants/bootstrap/DataLoadCertificatesTest.java
  17. 2 1
      src/test/java/scot/carricksoftware/grants/commands/census/CensusEntryCommandEnumTest.java
  18. 2 2
      src/test/java/scot/carricksoftware/grants/commands/certificates/BirthCertificateCommandThreeFieldsTest.java
  19. 2 1
      src/test/java/scot/carricksoftware/grants/converters/census/CensusEntryCommandConverterTest.java
  20. 2 1
      src/test/java/scot/carricksoftware/grants/converters/census/CensusEntryConverterTest.java
  21. 2 2
      src/test/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateCommandConverterTest.java
  22. 2 2
      src/test/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateConverterTest.java
  23. 2 1
      src/test/java/scot/carricksoftware/grants/domains/census/CensusEntryEnumTest.java
  24. 2 2
      src/test/java/scot/carricksoftware/grants/domains/certificates/BirthCertificatePartTwoTest.java
  25. 2 2
      src/test/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartThreeValidatorTest.java
  26. 2 2
      src/test/java/scot/carricksoftware/grants/validators/helpers/ValidateTypesNullTest.java

+ 2 - 1
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadCensus.java

@@ -17,6 +17,7 @@ import scot.carricksoftware.grants.domains.places.Place;
 import scot.carricksoftware.grants.enums.census.CensusBoundaryType;
 import scot.carricksoftware.grants.enums.census.CensusDate;
 import scot.carricksoftware.grants.enums.censusentry.*;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.general.YesNo;
 import scot.carricksoftware.grants.services.census.censusentry.CensusEntryService;
 import scot.carricksoftware.grants.services.census.census.CensusService;
@@ -82,7 +83,7 @@ public class DataLoadCensus {
         censusEntryCommand.setWorker(CensusEntryWorker.WORKER);
         censusEntryCommand.setAge("72");
         censusEntryCommand.setWhereBorn("Edinburgh");
-        censusEntryCommand.setSex(CensusEntrySex.MALE);
+        censusEntryCommand.setSex(Sex.MALE);
         censusEntryCommand.setBirthDay("25/01");
         censusEntryCommand.setBirthYear("1953");
         censusEntryCommand.setPersonalOccupation("AA Patrol");

+ 2 - 2
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadCertificates.java

@@ -13,7 +13,7 @@ import scot.carricksoftware.grants.commands.certificates.birthcertificates.Birth
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommandImpl;
 import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
 import scot.carricksoftware.grants.domains.places.Organisation;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.certificates.CertificateType;
 import scot.carricksoftware.grants.services.certificates.birthcertificates.BirthCertificateService;
 import scot.carricksoftware.grants.services.certificates.deathcertificates.DeathCertificateService;
@@ -60,7 +60,7 @@ public class DataLoadCertificates {
         birthCertificateCommand.setRegistrationAuthority(organisation);
         birthCertificateCommand.setNumber("01");
         birthCertificateCommand.setVolume("1953");
-        birthCertificateCommand.setSex(CensusEntrySex.MALE);
+        birthCertificateCommand.setSex(Sex.MALE);
         birthCertificateCommand.setWhenBorn("25/01/1953");
         birthCertificateCommand.setWhereBorn("Edinburgh");
 

+ 3 - 2
src/main/java/scot/carricksoftware/grants/commands/census/CensusEntryCommand.java

@@ -8,6 +8,7 @@ package scot.carricksoftware.grants.commands.census;
 import scot.carricksoftware.grants.domains.census.Census;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.enums.censusentry.*;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.general.YesNo;
 
 public interface CensusEntryCommand {
@@ -52,9 +53,9 @@ public interface CensusEntryCommand {
 
     void setWhereBorn(String whereBorn);
 
-    CensusEntrySex getSex();
+    Sex getSex();
 
-    void setSex(CensusEntrySex sex);
+    void setSex(Sex sex);
 
     String getBirthDay();
 

+ 4 - 3
src/main/java/scot/carricksoftware/grants/commands/census/CensusEntryCommandImpl.java

@@ -8,6 +8,7 @@ package scot.carricksoftware.grants.commands.census;
 import scot.carricksoftware.grants.domains.census.Census;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.enums.censusentry.*;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.general.YesNo;
 
 public class CensusEntryCommandImpl implements CensusEntryCommand {
@@ -32,7 +33,7 @@ public class CensusEntryCommandImpl implements CensusEntryCommand {
 
     private String whereBorn;
 
-    private CensusEntrySex Sex;
+    private Sex Sex;
 
     private String birthDay;
 
@@ -153,12 +154,12 @@ public class CensusEntryCommandImpl implements CensusEntryCommand {
     }
 
     @Override
-    public CensusEntrySex getSex() {
+    public Sex getSex() {
         return Sex;
     }
 
     @Override
-    public void setSex(CensusEntrySex sex) {
+    public void setSex(Sex sex) {
         Sex = sex;
     }
 

+ 3 - 3
src/main/java/scot/carricksoftware/grants/commands/certificates/birthcertificates/BirthCertificateCommand.java

@@ -7,7 +7,7 @@ package scot.carricksoftware.grants.commands.certificates.birthcertificates;
 
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.places.Organisation;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.certificates.CertificateType;
 
 public interface BirthCertificateCommand {
@@ -62,7 +62,7 @@ public interface BirthCertificateCommand {
 
     void setWhereBorn(String whereBorn);
 
-    CensusEntrySex getSex();
+    Sex getSex();
 
-    void setSex(CensusEntrySex sex);
+    void setSex(Sex sex);
 }

+ 4 - 4
src/main/java/scot/carricksoftware/grants/commands/certificates/birthcertificates/BirthCertificateCommandImpl.java

@@ -7,7 +7,7 @@ package scot.carricksoftware.grants.commands.certificates.birthcertificates;
 
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.places.Organisation;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.certificates.CertificateType;
 
 public class BirthCertificateCommandImpl implements BirthCertificateCommand {
@@ -34,7 +34,7 @@ public class BirthCertificateCommandImpl implements BirthCertificateCommand {
 
     private String whereBorn;
 
-    private CensusEntrySex sex;
+    private Sex sex;
 
 
     public Long getId() {
@@ -147,12 +147,12 @@ public class BirthCertificateCommandImpl implements BirthCertificateCommand {
     }
 
     @Override
-    public CensusEntrySex getSex() {
+    public Sex getSex() {
         return sex;
     }
 
     @Override
-    public void setSex(CensusEntrySex sex) {
+    public void setSex(Sex sex) {
         this.sex = sex;
     }
 }

+ 4 - 3
src/main/java/scot/carricksoftware/grants/domains/census/CensusEntry.java

@@ -9,6 +9,7 @@ import jakarta.persistence.*;
 import scot.carricksoftware.grants.BaseEntity;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.enums.censusentry.*;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.general.YesNo;
 
 @Entity
@@ -49,7 +50,7 @@ public class CensusEntry extends BaseEntity {
     @SuppressWarnings("JpaDataSourceORMInspection")
     @Enumerated(EnumType.STRING)
     @Column(name = "`sex`")
-    private CensusEntrySex sex;
+    private Sex sex;
 
     @SuppressWarnings("JpaDataSourceORMInspection")
     @Column(name = "`age`")
@@ -177,11 +178,11 @@ public class CensusEntry extends BaseEntity {
         this.whereBorn = whereBorn;
     }
 
-    public CensusEntrySex getSex() {
+    public Sex getSex() {
         return this.sex;
     }
 
-    public void setSex(CensusEntrySex sex) {
+    public void setSex(Sex sex) {
         this.sex = sex;
     }
 

+ 4 - 4
src/main/java/scot/carricksoftware/grants/domains/certificates/BirthCertificate.java

@@ -15,7 +15,7 @@ import jakarta.persistence.ManyToOne;
 import org.springframework.format.annotation.DateTimeFormat;
 import scot.carricksoftware.grants.constants.ApplicationConstants;
 import scot.carricksoftware.grants.domains.people.Person;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 
 @Entity
 public class BirthCertificate extends BaseCertificate {
@@ -37,7 +37,7 @@ public class BirthCertificate extends BaseCertificate {
     @SuppressWarnings("JpaDataSourceORMInspection")
     @Enumerated(EnumType.STRING)
     @Column(name = "`sex`")
-    private CensusEntrySex sex;
+    private Sex sex;
 
     public Person getNewBorn() {
         return newBorn;
@@ -63,11 +63,11 @@ public class BirthCertificate extends BaseCertificate {
         this.whereBorn = whereBorn;
     }
 
-    public CensusEntrySex getSex() {
+    public Sex getSex() {
         return sex;
     }
 
-    public void setSex(CensusEntrySex sex) {
+    public void setSex(Sex sex) {
         this.sex = sex;
     }
 }

+ 3 - 3
src/main/java/scot/carricksoftware/grants/enums/censusentry/CensusEntrySex.java → src/main/java/scot/carricksoftware/grants/enums/general/Sex.java

@@ -3,9 +3,9 @@
  *
  */
 
-package scot.carricksoftware.grants.enums.censusentry;
+package scot.carricksoftware.grants.enums.general;
 
-public enum CensusEntrySex {
+public enum Sex {
 
     @SuppressWarnings("unused") MALE("Male"),
     FEMALE ("Female");
@@ -14,7 +14,7 @@ public enum CensusEntrySex {
     public final String label;
 
     @SuppressWarnings("unused")
-    CensusEntrySex(String label) {
+    Sex(String label) {
         this.label = label;
     }
 }

+ 2 - 2
src/main/java/scot/carricksoftware/grants/validators/helpers/ValidateTypes.java

@@ -8,7 +8,7 @@ package scot.carricksoftware.grants.validators.helpers;
 import org.springframework.validation.BindingResult;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.places.Organisation;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.certificates.CertificateType;
 
 public interface ValidateTypes {
@@ -18,7 +18,7 @@ public interface ValidateTypes {
 
     void validateCertificateType(CertificateType certificateType, String field, String message, BindingResult bindingResult);
 
-    void validateSex(CensusEntrySex sex, String fieldName, String message, BindingResult bindingResult);
+    void validateSex(Sex sex, String fieldName, String message, BindingResult bindingResult);
 
     void validateNullOrEmptyString(String string, @SuppressWarnings("SameParameterValue") String field, @SuppressWarnings("SameParameterValue") String message, BindingResult bindingResult);
 

+ 2 - 2
src/main/java/scot/carricksoftware/grants/validators/helpers/ValidateTypesImpl.java

@@ -10,7 +10,7 @@ import org.springframework.validation.BindingResult;
 import scot.carricksoftware.grants.constants.ApplicationConstants;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.places.Organisation;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.certificates.CertificateType;
 
 import java.time.LocalDate;
@@ -41,7 +41,7 @@ public class ValidateTypesImpl implements ValidateTypes {
     }
 
     @Override
-    public void validateSex(CensusEntrySex sex, String fieldName, String message, BindingResult bindingResult) {
+    public void validateSex(Sex sex, String fieldName, String message, BindingResult bindingResult) {
         if (sex == null) {
             bindingResult.rejectValue(fieldName, ApplicationConstants.EMPTY_STRING, null, message);
         }

+ 1 - 1
src/main/resources/templates/censusEntry/form.html

@@ -57,7 +57,7 @@ rounded-3 text-center p-4">
                 <div>
                     <select id="sex" style="width: 200px;" name="sex" th:field="*{sex}">
                         <option th:value="${''}" th:text="${''}"></option>
-                        <option th:each="value : ${T(scot.carricksoftware.grants.enums.censusentry.CensusEntrySex).values()}"
+                        <option th:each="value : ${T(scot.carricksoftware.grants.enums.general.Sex).values()}"
                                 th:value="${value}" th:text="${value.label}"></option>
                     </select>
                 </div>

+ 1 - 1
src/main/resources/templates/certificates/birthCertificate/form.html

@@ -182,7 +182,7 @@
                 <td style="text-align: left;">
                     <select id="sex" style="width: 200px;" name="sex" th:field="*{sex}">
                         <option th:value="${''}" th:text="${''}"></option>
-                        <option th:each="value : ${T(scot.carricksoftware.grants.enums.censusentry.CensusEntrySex).values()}"
+                        <option th:each="value : ${T(scot.carricksoftware.grants.enums.general.Sex).values()}"
                                 th:value="${value}" th:text="${value.label}"></option>
                     </select>
                     <div th:if="${#fields.hasErrors('sex')}">

+ 3 - 2
src/test/java/scot/carricksoftware/grants/GenerateCensusEntryRandomEnums.java

@@ -7,6 +7,7 @@ package scot.carricksoftware.grants;
 
 import org.springframework.stereotype.Component;
 import scot.carricksoftware.grants.enums.censusentry.*;
+import scot.carricksoftware.grants.enums.general.Sex;
 
 import java.util.Random;
 
@@ -47,8 +48,8 @@ public class GenerateCensusEntryRandomEnums {
         return workers[randomInt];
     }
 
-    public static CensusEntrySex GetRandomCensusEntrySex() {
-        CensusEntrySex[] sex = CensusEntrySex.values();
+    public static Sex GetRandomCensusEntrySex() {
+        Sex[] sex = Sex.values();
 
         Random random = new Random();
         int randomInt = random.nextInt(0, sex.length);

+ 2 - 1
src/test/java/scot/carricksoftware/grants/bootstrap/DataLoadCensusTest.java

@@ -14,6 +14,7 @@ import scot.carricksoftware.grants.domains.places.Place;
 import scot.carricksoftware.grants.enums.census.CensusBoundaryType;
 import scot.carricksoftware.grants.enums.census.CensusDate;
 import scot.carricksoftware.grants.enums.censusentry.*;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.general.YesNo;
 import scot.carricksoftware.grants.services.census.censusentry.CensusEntryService;
 import scot.carricksoftware.grants.services.census.census.CensusService;
@@ -96,7 +97,7 @@ public class DataLoadCensusTest {
         assertEquals(CensusEntryWorker.WORKER, captor.getValue().getWorker());
         assertEquals("72", captor.getValue().getAge());
         assertEquals("Edinburgh", captor.getValue().getWhereBorn());
-        assertEquals(CensusEntrySex.MALE, captor.getValue().getSex());
+        assertEquals(Sex.MALE, captor.getValue().getSex());
         assertEquals("25/01", captor.getValue().getBirthDay());
         assertEquals("1953", captor.getValue().getBirthYear());
         assertEquals("AA Patrol", captor.getValue().getPersonalOccupation());

+ 2 - 2
src/test/java/scot/carricksoftware/grants/bootstrap/DataLoadCertificatesTest.java

@@ -10,7 +10,7 @@ import scot.carricksoftware.grants.commands.certificates.birthcertificates.Birth
 import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.places.Organisation;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.certificates.CertificateType;
 import scot.carricksoftware.grants.services.certificates.birthcertificates.BirthCertificateService;
 import scot.carricksoftware.grants.services.certificates.deathcertificates.DeathCertificateService;
@@ -69,7 +69,7 @@ public class DataLoadCertificatesTest {
         assertEquals(organisation, captor.getValue().getRegistrationAuthority());
         assertEquals("01", captor.getValue().getNumber());
         assertEquals("1953", captor.getValue().getVolume());
-        assertEquals(CensusEntrySex.MALE, captor.getValue().getSex());
+        assertEquals(Sex.MALE, captor.getValue().getSex());
         assertEquals("25/01/1953", captor.getValue().getWhenBorn());
         assertEquals("Edinburgh", captor.getValue().getWhereBorn());
     }

+ 2 - 1
src/test/java/scot/carricksoftware/grants/commands/census/CensusEntryCommandEnumTest.java

@@ -9,6 +9,7 @@ package scot.carricksoftware.grants.commands.census;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import scot.carricksoftware.grants.enums.censusentry.*;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.general.YesNo;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -80,7 +81,7 @@ class CensusEntryCommandEnumTest {
 
     @Test
     void setSexTest() {
-        CensusEntrySex sex = GetRandomCensusEntrySex();
+        Sex sex = GetRandomCensusEntrySex();
         command.setSex(sex);
         assertEquals(sex, command.getSex());
     }

+ 2 - 2
src/test/java/scot/carricksoftware/grants/commands/certificates/BirthCertificateCommandThreeFieldsTest.java

@@ -9,7 +9,7 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommandImpl;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNull;
@@ -56,7 +56,7 @@ class BirthCertificateCommandThreeFieldsTest {
 
     @Test
     void setSexTest() {
-        CensusEntrySex sex = GetRandomCensusEntrySex();
+        Sex sex = GetRandomCensusEntrySex();
         command.setSex(sex);
         assertEquals(sex, command.getSex());
     }

+ 2 - 1
src/test/java/scot/carricksoftware/grants/converters/census/CensusEntryCommandConverterTest.java

@@ -13,6 +13,7 @@ import scot.carricksoftware.grants.domains.census.Census;
 import scot.carricksoftware.grants.domains.census.CensusEntry;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.enums.censusentry.*;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.general.YesNo;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -45,7 +46,7 @@ class CensusEntryCommandConverterTest {
         Person person = GetRandomPerson();
         String age = GetRandomString();
         String whereBorn = GetRandomString();
-        CensusEntrySex sex = GetRandomCensusEntrySex();
+        Sex sex = GetRandomCensusEntrySex();
         String birthYear = GetRandomString();
         String birthDay = GetRandomString();
         String personalOccupation = GetRandomString();

+ 2 - 1
src/test/java/scot/carricksoftware/grants/converters/census/CensusEntryConverterTest.java

@@ -12,6 +12,7 @@ import scot.carricksoftware.grants.domains.census.Census;
 import scot.carricksoftware.grants.domains.census.CensusEntry;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.enums.censusentry.*;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.general.YesNo;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -44,7 +45,7 @@ class CensusEntryConverterTest {
         Person person = GetRandomPerson();
         String age = GetRandomString();
         String whereBorn = GetRandomString();
-        CensusEntrySex sex = GetRandomCensusEntrySex();
+        Sex sex = GetRandomCensusEntrySex();
         String birthYear = GetRandomString();
         String birthDay = GetRandomString();
         String personalOccupation = GetRandomString();

+ 2 - 2
src/test/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateCommandConverterTest.java

@@ -13,7 +13,7 @@ import scot.carricksoftware.grants.commands.certificates.birthcertificates.Birth
 import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.places.Organisation;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.certificates.CertificateType;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -43,7 +43,7 @@ class BirthCertificateCommandConverterTest {
         Organisation registrationAuthority = GetRandomOrganisation();
         String volume = GetRandomString();
         String number = GetRandomString();
-        CensusEntrySex sex = CensusEntrySex.MALE;
+        Sex sex = Sex.MALE;
         String whenBorn = GetRandomString();
         String whereBorn = GetRandomString();
 

+ 2 - 2
src/test/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateConverterTest.java

@@ -12,7 +12,7 @@ import scot.carricksoftware.grants.commands.certificates.birthcertificates.Birth
 import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.places.Organisation;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.certificates.CertificateType;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -42,7 +42,7 @@ class BirthCertificateConverterTest {
         Organisation registrationAuthority = GetRandomOrganisation();
         String volume = GetRandomString();
         String number = GetRandomString();
-        CensusEntrySex sex = CensusEntrySex.MALE;
+        Sex sex = Sex.MALE;
         String whenBorn = GetRandomString();
         String whereBorn = GetRandomString();
 

+ 2 - 1
src/test/java/scot/carricksoftware/grants/domains/census/CensusEntryEnumTest.java

@@ -10,6 +10,7 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.junit.jupiter.MockitoExtension;
 import scot.carricksoftware.grants.enums.censusentry.*;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.general.YesNo;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -82,7 +83,7 @@ class CensusEntryEnumTest {
 
     @Test
     void setSexTest() {
-        CensusEntrySex sex = GetRandomCensusEntrySex();
+        Sex sex = GetRandomCensusEntrySex();
         entry.setSex(sex);
         assertEquals(sex, entry.getSex());
     }

+ 2 - 2
src/test/java/scot/carricksoftware/grants/domains/certificates/BirthCertificatePartTwoTest.java

@@ -7,7 +7,7 @@ package scot.carricksoftware.grants.domains.certificates;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNull;
@@ -54,7 +54,7 @@ class BirthCertificatePartTwoTest {
 
     @Test
     void setSexTest() {
-        CensusEntrySex sex = GetRandomCensusEntrySex();
+        Sex sex = GetRandomCensusEntrySex();
         certificate.setSex(sex);
         assertEquals(sex, certificate.getSex());
     }

+ 2 - 2
src/test/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartThreeValidatorTest.java

@@ -12,7 +12,7 @@ import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
 import org.springframework.validation.BindingResult;
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.validators.helpers.ValidateTypes;
 
 import static org.mockito.Mockito.verify;
@@ -48,7 +48,7 @@ class BirthCertificateCommandPartThreeValidatorTest {
 
     @Test
     void validateSexTest() {
-        CensusEntrySex sex = CensusEntrySex.MALE;
+        Sex sex = Sex.MALE;
         when(birthCertificateCommandMock.getSex()).thenReturn(sex);
         validator.validate(birthCertificateCommandMock, bindingResultMock);
         verify(validateTypesMock).validateSex(sex, "sex","Sex cannot be null.", bindingResultMock);

+ 2 - 2
src/test/java/scot/carricksoftware/grants/validators/helpers/ValidateTypesNullTest.java

@@ -14,7 +14,7 @@ import org.springframework.validation.BindingResult;
 import scot.carricksoftware.grants.constants.ApplicationConstants;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.places.Organisation;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntrySex;
+import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.certificates.CertificateType;
 
 import static org.mockito.Mockito.verify;
@@ -71,7 +71,7 @@ class ValidateTypesNullTest {
 
     @Test
     void nonNullSexTest() {
-        validateTypes.validateSex(CensusEntrySex.MALE, field, message, bindingResultMock);
+        validateTypes.validateSex(Sex.MALE, field, message, bindingResultMock);
         verifyNoInteractions(bindingResultMock);
     }