Selaa lähdekoodia

BirthCertificateCommand Validators refactor

Andrew Grant 6 kuukautta sitten
vanhempi
commit
ed2e39498c
34 muutettua tiedostoa jossa 185 lisäystä ja 68 poistoa
  1. 5 5
      src/main/java/scot/carricksoftware/grants/controllers/certificates/birthcertificates/BirthCertificateFormControllerImpl.java
  2. 1 1
      src/main/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerImpl.java
  3. 1 1
      src/main/java/scot/carricksoftware/grants/controllers/certificates/divorcecertificates/DivorceCertificateFormControllerImpl.java
  4. 1 1
      src/main/java/scot/carricksoftware/grants/controllers/certificates/marriagecertificates/MarriageCertificateFormControllerImpl.java
  5. 19 0
      src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartOneValidator.java
  6. 7 8
      src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartOneValidatorImpl.java
  7. 18 0
      src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartThreeValidator.java
  8. 5 4
      src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartThreeValidatorImpl.java
  9. 15 0
      src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartTwoValidator.java
  10. 5 5
      src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartTwoValidatorImpl.java
  11. 14 0
      src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandValidator.java
  12. 10 10
      src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandValidatorImpl.java
  13. 2 2
      src/main/java/scot/carricksoftware/grants/validators/certificates/deathcertificate/DeathCertificateCommandValidator.java
  14. 2 2
      src/main/java/scot/carricksoftware/grants/validators/certificates/deathcertificate/DivorceCertificateCommandValidator.java
  15. 2 2
      src/main/java/scot/carricksoftware/grants/validators/certificates/deathcertificate/MarriageCertificateCommandValidator.java
  16. 3 3
      src/test/java/scot/carricksoftware/grants/controllers/certificates/birthcertificates/BirthCertificateFormControllerSaveOrUpdateTest.java
  17. 3 3
      src/test/java/scot/carricksoftware/grants/controllers/certificates/birthcertificates/BirthCertificateFormControllerTest.java
  18. 4 4
      src/test/java/scot/carricksoftware/grants/controllers/certificates/birthcertificates/BirthCertificateFormControllerValidationTest.java
  19. 1 1
      src/test/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerSaveOrUpdateTest.java
  20. 1 1
      src/test/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerTest.java
  21. 1 1
      src/test/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerValidationTest.java
  22. 1 1
      src/test/java/scot/carricksoftware/grants/controllers/certificates/divorcecertificates/DivorceCertificateFormControllerSaveOrUpdateTest.java
  23. 1 1
      src/test/java/scot/carricksoftware/grants/controllers/certificates/divorcecertificates/DivorceCertificateFormControllerTest.java
  24. 1 1
      src/test/java/scot/carricksoftware/grants/controllers/certificates/divorcecertificates/DivorceCertificateFormControllerValidationTest.java
  25. 1 1
      src/test/java/scot/carricksoftware/grants/controllers/certificates/marriagecertificates/MarriageCertificateFormControllerSaveOrUpdateTest.java
  26. 1 1
      src/test/java/scot/carricksoftware/grants/controllers/certificates/marriagecertificates/MarriageCertificateFormControllerTest.java
  27. 1 1
      src/test/java/scot/carricksoftware/grants/controllers/certificates/marriagecertificates/MarriageCertificateFormControllerValidationTest.java
  28. 1 0
      src/test/java/scot/carricksoftware/grants/validators/certificates/DeathCertificateCommandValidatorTest.java
  29. 1 0
      src/test/java/scot/carricksoftware/grants/validators/certificates/DivorceCertificateCommandValidatorTest.java
  30. 1 0
      src/test/java/scot/carricksoftware/grants/validators/certificates/MarriageCertificateCommandValidatorTest.java
  31. 16 0
      src/test/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartOneValidatorTest.java
  32. 16 0
      src/test/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartThreeValidatorTest.java
  33. 16 0
      src/test/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartTwoValidatorTest.java
  34. 8 8
      src/test/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandValidatorImplTest.java

+ 5 - 5
src/main/java/scot/carricksoftware/grants/controllers/certificates/birthcertificates/BirthCertificateFormControllerImpl.java

@@ -26,7 +26,7 @@ import scot.carricksoftware.grants.converters.certificates.birthcertificates.Bir
 import scot.carricksoftware.grants.services.certificates.birthcertificates.BirthCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
 import scot.carricksoftware.grants.services.places.organisations.OrganisationService;
-import scot.carricksoftware.grants.validators.certificates.BirthCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.birthcertificate.BirthCertificateCommandValidatorImpl;
 
 @SuppressWarnings("LoggingSimilarMessage")
 @Controller
@@ -37,7 +37,7 @@ public class BirthCertificateFormControllerImpl implements BirthCertificateFormC
     @SuppressWarnings({"FieldCanBeLocal", "unused"})
     private final BirthCertificateCommandConverterImpl birthCertificateCommandConverter;
     private final BirthCertificateConverterImpl birthCertificateConverter;
-    private final BirthCertificateCommandValidator birthCertificateCommandValidator;
+    private final BirthCertificateCommandValidatorImpl birthCertificateCommandValidatorImpl;
     private final PersonService personService;
     private final OrganisationService organisationService;
 
@@ -45,7 +45,7 @@ public class BirthCertificateFormControllerImpl implements BirthCertificateFormC
     public BirthCertificateFormControllerImpl(BirthCertificateService birthCertificateService,
                                               BirthCertificateCommandConverterImpl birthCertificateCommandConverter,
                                               BirthCertificateConverterImpl birthCertificateConverter,
-                                              BirthCertificateCommandValidator birthCertificateCommandValidator,
+                                              BirthCertificateCommandValidatorImpl birthCertificateCommandValidatorImpl,
                                               PersonService personService,
                                               OrganisationService organisationService) {
         this.birthCertificateService = birthCertificateService;
@@ -53,7 +53,7 @@ public class BirthCertificateFormControllerImpl implements BirthCertificateFormC
 
 
         this.birthCertificateConverter = birthCertificateConverter;
-        this.birthCertificateCommandValidator = birthCertificateCommandValidator;
+        this.birthCertificateCommandValidatorImpl = birthCertificateCommandValidatorImpl;
         this.personService = personService;
         this.organisationService = organisationService;
     }
@@ -86,7 +86,7 @@ public class BirthCertificateFormControllerImpl implements BirthCertificateFormC
     public String saveOrUpdate(@Valid @ModelAttribute BirthCertificateCommand birthCertificateCommand, BindingResult bindingResult, Model model) {
         logger.debug("BirthCertificateFormControllerImpl::saveOrUpdate");
 
-        birthCertificateCommandValidator.validate(birthCertificateCommand, bindingResult);
+        birthCertificateCommandValidatorImpl.validate(birthCertificateCommand, bindingResult);
 
 
         if (bindingResult.hasErrors()) {

+ 1 - 1
src/main/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerImpl.java

@@ -25,7 +25,7 @@ import scot.carricksoftware.grants.converters.certificates.deathcertificates.Dea
 import scot.carricksoftware.grants.converters.certificates.deathcertificates.DeathCertificateConverterImpl;
 import scot.carricksoftware.grants.services.certificates.deathcertificates.DeathCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.DeathCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.DeathCertificateCommandValidator;
 
 @SuppressWarnings("LoggingSimilarMessage")
 @Controller

+ 1 - 1
src/main/java/scot/carricksoftware/grants/controllers/certificates/divorcecertificates/DivorceCertificateFormControllerImpl.java

@@ -25,7 +25,7 @@ import scot.carricksoftware.grants.converters.certificates.divorcecertificates.D
 import scot.carricksoftware.grants.converters.certificates.divorcecertificates.DivorceCertificateConverterImpl;
 import scot.carricksoftware.grants.services.certificates.divorcecertificates.DivorceCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.DivorceCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.DivorceCertificateCommandValidator;
 
 
 @SuppressWarnings("LoggingSimilarMessage")

+ 1 - 1
src/main/java/scot/carricksoftware/grants/controllers/certificates/marriagecertificates/MarriageCertificateFormControllerImpl.java

@@ -25,7 +25,7 @@ import scot.carricksoftware.grants.converters.certificates.marriagecertificates.
 import scot.carricksoftware.grants.converters.certificates.marriagecertificates.MarriageCertificateConverterImpl;
 import scot.carricksoftware.grants.services.certificates.marriagecertificates.MarriageCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.MarriageCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.MarriageCertificateCommandValidator;
 
 @SuppressWarnings("LoggingSimilarMessage")
 @Controller

+ 19 - 0
src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartOneValidator.java

@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
+
+import org.springframework.stereotype.Component;
+import org.springframework.validation.BindingResult;
+import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
+
+
+@Component
+public interface BirthCertificateCommandPartOneValidator {
+
+
+    void validate(BirthCertificateCommand birthCertificateCommand, BindingResult bindingResult);
+}
+

+ 7 - 8
src/main/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandPartOneValidator.java → src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartOneValidatorImpl.java

@@ -1,9 +1,9 @@
 /*
- * Copyright (c) Andrew Grant of Carrick Software 19/03/2025, 09:50. All rights reserved.
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
  *
  */
 
-package scot.carricksoftware.grants.validators.certificates;
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -15,17 +15,17 @@ import scot.carricksoftware.grants.validators.helpers.ValidateTypes;
 
 
 @Component
-public class BirthCertificateCommandPartOneValidator {
+public class BirthCertificateCommandPartOneValidatorImpl implements BirthCertificateCommandPartOneValidator {
 
-    private static final Logger logger = LogManager.getLogger(BirthCertificateCommandPartOneValidator.class);
+    private static final Logger logger = LogManager.getLogger(BirthCertificateCommandPartOneValidatorImpl.class);
 
     private final ValidateTypes validateTypes;
 
-    public BirthCertificateCommandPartOneValidator(ValidateTypes validateTypes) {
+    public BirthCertificateCommandPartOneValidatorImpl(ValidateTypes validateTypes) {
         this.validateTypes = validateTypes;
     }
 
-    @SuppressWarnings("unused")
+    @Override
     public void validate(BirthCertificateCommand birthCertificateCommand, BindingResult bindingResult) {
         logger.debug("Validating birth certificate command (part one)");
 
@@ -38,7 +38,7 @@ public class BirthCertificateCommandPartOneValidator {
 
     private void validateNewBorn(BirthCertificateCommand birthCertificateCommand, BindingResult bindingResult) {
         logger.debug("Validating birth certificate newBorn");
-        validateTypes.validatePerson(birthCertificateCommand.getNewBorn(),"newBorn", ValidationConstants.NEWBORN_IS_NULL, bindingResult);
+        validateTypes.validatePerson(birthCertificateCommand.getNewBorn(), "newBorn", ValidationConstants.NEWBORN_IS_NULL, bindingResult);
     }
 
 
@@ -68,6 +68,5 @@ public class BirthCertificateCommandPartOneValidator {
     }
 
 
-
 }
 

+ 18 - 0
src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartThreeValidator.java

@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
+
+import org.springframework.stereotype.Component;
+import org.springframework.validation.BindingResult;
+import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
+
+
+@Component
+public interface BirthCertificateCommandPartThreeValidator {
+
+
+    void validate(BirthCertificateCommand birthCertificateCommand, BindingResult bindingResult);
+}

+ 5 - 4
src/main/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandPartThreeValidator.java → src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartThreeValidatorImpl.java

@@ -3,7 +3,7 @@
  *
  */
 
-package scot.carricksoftware.grants.validators.certificates;
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -15,16 +15,17 @@ import scot.carricksoftware.grants.validators.helpers.ValidateTypes;
 
 
 @Component
-public class BirthCertificateCommandPartThreeValidator {
+public class BirthCertificateCommandPartThreeValidatorImpl implements BirthCertificateCommandPartThreeValidator {
 
-    private static final Logger logger = LogManager.getLogger(BirthCertificateCommandPartThreeValidator.class);
+    private static final Logger logger = LogManager.getLogger(BirthCertificateCommandPartThreeValidatorImpl.class);
 
     private final ValidateTypes validateTypes;
 
-    public BirthCertificateCommandPartThreeValidator(ValidateTypes validateTypes) {
+    public BirthCertificateCommandPartThreeValidatorImpl(ValidateTypes validateTypes) {
         this.validateTypes = validateTypes;
     }
 
+    @Override
     public void validate(BirthCertificateCommand birthCertificateCommand, BindingResult bindingResult) {
         logger.debug("Validating birth certificate command (part three)");
 

+ 15 - 0
src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartTwoValidator.java

@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public interface BirthCertificateCommandPartTwoValidator {
+
+
+}
+

+ 5 - 5
src/main/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandPartTwoValidator.java → src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartTwoValidatorImpl.java

@@ -1,9 +1,9 @@
 /*
- * Copyright (c) Andrew Grant of Carrick Software 19/03/2025, 09:50. All rights reserved.
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
  *
  */
 
-package scot.carricksoftware.grants.validators.certificates;
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -14,13 +14,13 @@ import scot.carricksoftware.grants.constants.ValidationConstants;
 import scot.carricksoftware.grants.validators.helpers.ValidateTypes;
 
 @Component
-public class BirthCertificateCommandPartTwoValidator {
+public class BirthCertificateCommandPartTwoValidatorImpl implements BirthCertificateCommandPartTwoValidator {
 
-    private static final Logger logger = LogManager.getLogger(BirthCertificateCommandPartTwoValidator.class);
+    private static final Logger logger = LogManager.getLogger(BirthCertificateCommandPartTwoValidatorImpl.class);
 
     private final ValidateTypes validateTypes;
 
-    public BirthCertificateCommandPartTwoValidator(ValidateTypes validateTypes) {
+    public BirthCertificateCommandPartTwoValidatorImpl(ValidateTypes validateTypes) {
         this.validateTypes = validateTypes;
     }
 

+ 14 - 0
src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandValidator.java

@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public interface BirthCertificateCommandValidator {
+
+}
+

+ 10 - 10
src/main/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandValidator.java → src/main/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandValidatorImpl.java

@@ -1,9 +1,9 @@
 /*
- * Copyright (c) Andrew Grant of Carrick Software 19/03/2025, 09:50. All rights reserved.
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
  *
  */
 
-package scot.carricksoftware.grants.validators.certificates;
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -12,16 +12,16 @@ import org.springframework.validation.BindingResult;
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
 
 @Component
-public class BirthCertificateCommandValidator {
-    private static final Logger logger = LogManager.getLogger(BirthCertificateCommandValidator.class);
+public class BirthCertificateCommandValidatorImpl implements BirthCertificateCommandValidator {
+    private static final Logger logger = LogManager.getLogger(BirthCertificateCommandValidatorImpl.class);
 
-    private final BirthCertificateCommandPartOneValidator partOneValidator;
-    private final BirthCertificateCommandPartTwoValidator partTwoValidator;
-    private final BirthCertificateCommandPartThreeValidator partThreeValidator;
+    private final BirthCertificateCommandPartOneValidatorImpl partOneValidator;
+    private final BirthCertificateCommandPartTwoValidatorImpl partTwoValidator;
+    private final BirthCertificateCommandPartThreeValidatorImpl partThreeValidator;
 
-    public BirthCertificateCommandValidator(BirthCertificateCommandPartOneValidator partOneValidator,
-                                            BirthCertificateCommandPartTwoValidator partTwoValidator,
-                                            BirthCertificateCommandPartThreeValidator partThreeValidator) {
+    public BirthCertificateCommandValidatorImpl(BirthCertificateCommandPartOneValidatorImpl partOneValidator,
+                                                BirthCertificateCommandPartTwoValidatorImpl partTwoValidator,
+                                                BirthCertificateCommandPartThreeValidatorImpl partThreeValidator) {
         this.partOneValidator = partOneValidator;
         this.partTwoValidator = partTwoValidator;
         this.partThreeValidator = partThreeValidator;

+ 2 - 2
src/main/java/scot/carricksoftware/grants/validators/certificates/DeathCertificateCommandValidator.java → src/main/java/scot/carricksoftware/grants/validators/certificates/deathcertificate/DeathCertificateCommandValidator.java

@@ -1,9 +1,9 @@
 /*
- * Copyright (c) Andrew Grant of Carrick Software 19/03/2025, 09:50. All rights reserved.
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
  *
  */
 
-package scot.carricksoftware.grants.validators.certificates;
+package scot.carricksoftware.grants.validators.certificates.deathcertificate;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;

+ 2 - 2
src/main/java/scot/carricksoftware/grants/validators/certificates/DivorceCertificateCommandValidator.java → src/main/java/scot/carricksoftware/grants/validators/certificates/deathcertificate/DivorceCertificateCommandValidator.java

@@ -1,9 +1,9 @@
 /*
- * Copyright (c) Andrew Grant of Carrick Software 19/03/2025, 09:50. All rights reserved.
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
  *
  */
 
-package scot.carricksoftware.grants.validators.certificates;
+package scot.carricksoftware.grants.validators.certificates.deathcertificate;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;

+ 2 - 2
src/main/java/scot/carricksoftware/grants/validators/certificates/MarriageCertificateCommandValidator.java → src/main/java/scot/carricksoftware/grants/validators/certificates/deathcertificate/MarriageCertificateCommandValidator.java

@@ -1,9 +1,9 @@
 /*
- * Copyright (c) Andrew Grant of Carrick Software 19/03/2025, 09:50. All rights reserved.
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
  *
  */
 
-package scot.carricksoftware.grants.validators.certificates;
+package scot.carricksoftware.grants.validators.certificates.deathcertificate;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;

+ 3 - 3
src/test/java/scot/carricksoftware/grants/controllers/certificates/birthcertificates/BirthCertificateFormControllerSaveOrUpdateTest.java

@@ -19,7 +19,7 @@ import scot.carricksoftware.grants.converters.certificates.birthcertificates.Bir
 import scot.carricksoftware.grants.services.certificates.birthcertificates.BirthCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
 import scot.carricksoftware.grants.services.places.organisations.OrganisationService;
-import scot.carricksoftware.grants.validators.certificates.BirthCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.birthcertificate.BirthCertificateCommandValidatorImpl;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
@@ -55,7 +55,7 @@ public class BirthCertificateFormControllerSaveOrUpdateTest {
     BindingResult bindingResultMock;
 
     @Mock
-    private BirthCertificateCommandValidator birthCertificateCommandValidatorMock;
+    private BirthCertificateCommandValidatorImpl birthCertificateCommandValidatorImplMock;
 
     private BirthCertificateCommand birthCertificateCommand;
 
@@ -65,7 +65,7 @@ public class BirthCertificateFormControllerSaveOrUpdateTest {
         birthCertificateController = new BirthCertificateFormControllerImpl(birthCertificateServiceMock,
                 birthCertificateCommandConverterMock,
                 birthCertificateConverterMock,
-                birthCertificateCommandValidatorMock,
+                birthCertificateCommandValidatorImplMock,
                 personServiceMock,
                 organisationServiceMock);
         birthCertificateCommand = new BirthCertificateCommandImpl();

+ 3 - 3
src/test/java/scot/carricksoftware/grants/controllers/certificates/birthcertificates/BirthCertificateFormControllerTest.java

@@ -21,7 +21,7 @@ import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
 import scot.carricksoftware.grants.services.certificates.birthcertificates.BirthCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
 import scot.carricksoftware.grants.services.places.organisations.OrganisationService;
-import scot.carricksoftware.grants.validators.certificates.BirthCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.birthcertificate.BirthCertificateCommandValidatorImpl;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -56,7 +56,7 @@ public class BirthCertificateFormControllerTest {
     private Model modelMock;
 
     @Mock
-    private BirthCertificateCommandValidator birthCertificateCommandValidatorMock;
+    private BirthCertificateCommandValidatorImpl birthCertificateCommandValidatorImplMock;
 
 
     @BeforeEach
@@ -64,7 +64,7 @@ public class BirthCertificateFormControllerTest {
         birthCertificateFormController = new BirthCertificateFormControllerImpl(birthCertificateServiceMock,
                 birthCertificateCommandConverterMock,
                 birthCertificateConverterMock,
-                birthCertificateCommandValidatorMock,
+                birthCertificateCommandValidatorImplMock,
                 personServiceMock,
                 organisationServiceMock);
     }

+ 4 - 4
src/test/java/scot/carricksoftware/grants/controllers/certificates/birthcertificates/BirthCertificateFormControllerValidationTest.java

@@ -20,7 +20,7 @@ import scot.carricksoftware.grants.converters.certificates.birthcertificates.Bir
 import scot.carricksoftware.grants.services.certificates.birthcertificates.BirthCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
 import scot.carricksoftware.grants.services.places.organisations.OrganisationService;
-import scot.carricksoftware.grants.validators.certificates.BirthCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.birthcertificate.BirthCertificateCommandValidatorImpl;
 
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -52,7 +52,7 @@ public class BirthCertificateFormControllerValidationTest {
     private OrganisationService organisationServiceMock;
 
     @Mock
-    private BirthCertificateCommandValidator birthCertificateCommandValidatorMock;
+    private BirthCertificateCommandValidatorImpl birthCertificateCommandValidatorImplMock;
 
     @Mock
     private Model modelMock;
@@ -63,7 +63,7 @@ public class BirthCertificateFormControllerValidationTest {
         birthCertificateController = new BirthCertificateFormControllerImpl(birthCertificateServiceMock,
                 birthCertificateCommandConverterMock,
                 birthCertificateConverterMock,
-                birthCertificateCommandValidatorMock,
+                birthCertificateCommandValidatorImplMock,
                 personServiceMock,
                 organisationServiceMock);
     }
@@ -78,7 +78,7 @@ public class BirthCertificateFormControllerValidationTest {
 
         birthCertificateController.saveOrUpdate(birthCertificateCommand, bindingResultMock, modelMock);
 
-        verify(birthCertificateCommandValidatorMock).validate(birthCertificateCommand, bindingResultMock);
+        verify(birthCertificateCommandValidatorImplMock).validate(birthCertificateCommand, bindingResultMock);
     }
 
 

+ 1 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerSaveOrUpdateTest.java

@@ -18,7 +18,7 @@ import scot.carricksoftware.grants.converters.certificates.deathcertificates.Dea
 import scot.carricksoftware.grants.converters.certificates.deathcertificates.DeathCertificateConverterImpl;
 import scot.carricksoftware.grants.services.certificates.deathcertificates.DeathCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.DeathCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.DeathCertificateCommandValidator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.ArgumentMatchers.any;

+ 1 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerTest.java

@@ -20,7 +20,7 @@ import scot.carricksoftware.grants.converters.certificates.deathcertificates.Dea
 import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
 import scot.carricksoftware.grants.services.certificates.deathcertificates.DeathCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.DeathCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.DeathCertificateCommandValidator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;

+ 1 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerValidationTest.java

@@ -19,7 +19,7 @@ import scot.carricksoftware.grants.converters.certificates.deathcertificates.Dea
 import scot.carricksoftware.grants.converters.certificates.deathcertificates.DeathCertificateConverterImpl;
 import scot.carricksoftware.grants.services.certificates.deathcertificates.DeathCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.DeathCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.DeathCertificateCommandValidator;
 
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;

+ 1 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/divorcecertificates/DivorceCertificateFormControllerSaveOrUpdateTest.java

@@ -18,7 +18,7 @@ import scot.carricksoftware.grants.converters.certificates.divorcecertificates.D
 import scot.carricksoftware.grants.converters.certificates.divorcecertificates.DivorceCertificateConverterImpl;
 import scot.carricksoftware.grants.services.certificates.divorcecertificates.DivorceCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.DivorceCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.DivorceCertificateCommandValidator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.ArgumentMatchers.any;

+ 1 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/divorcecertificates/DivorceCertificateFormControllerTest.java

@@ -20,7 +20,7 @@ import scot.carricksoftware.grants.converters.certificates.divorcecertificates.D
 import scot.carricksoftware.grants.domains.certificates.DivorceCertificate;
 import scot.carricksoftware.grants.services.certificates.divorcecertificates.DivorceCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.DivorceCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.DivorceCertificateCommandValidator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;

+ 1 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/divorcecertificates/DivorceCertificateFormControllerValidationTest.java

@@ -19,7 +19,7 @@ import scot.carricksoftware.grants.converters.certificates.divorcecertificates.D
 import scot.carricksoftware.grants.converters.certificates.divorcecertificates.DivorceCertificateConverterImpl;
 import scot.carricksoftware.grants.services.certificates.divorcecertificates.DivorceCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.DivorceCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.DivorceCertificateCommandValidator;
 
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;

+ 1 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/marriagecertificates/MarriageCertificateFormControllerSaveOrUpdateTest.java

@@ -18,7 +18,7 @@ import scot.carricksoftware.grants.converters.certificates.marriagecertificates.
 import scot.carricksoftware.grants.converters.certificates.marriagecertificates.MarriageCertificateConverterImpl;
 import scot.carricksoftware.grants.services.certificates.marriagecertificates.MarriageCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.MarriageCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.MarriageCertificateCommandValidator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.ArgumentMatchers.any;

+ 1 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/marriagecertificates/MarriageCertificateFormControllerTest.java

@@ -20,7 +20,7 @@ import scot.carricksoftware.grants.converters.certificates.marriagecertificates.
 import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
 import scot.carricksoftware.grants.services.certificates.marriagecertificates.MarriageCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.MarriageCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.MarriageCertificateCommandValidator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;

+ 1 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/marriagecertificates/MarriageCertificateFormControllerValidationTest.java

@@ -19,7 +19,7 @@ import scot.carricksoftware.grants.converters.certificates.marriagecertificates.
 import scot.carricksoftware.grants.converters.certificates.marriagecertificates.MarriageCertificateConverterImpl;
 import scot.carricksoftware.grants.services.certificates.marriagecertificates.MarriageCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.validators.certificates.MarriageCertificateCommandValidator;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.MarriageCertificateCommandValidator;
 
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;

+ 1 - 0
src/test/java/scot/carricksoftware/grants/validators/certificates/DeathCertificateCommandValidatorTest.java

@@ -15,6 +15,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
 import org.springframework.validation.BindingResult;
 import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommand;
 import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommandImpl;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.DeathCertificateCommandValidator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.Mockito.verify;

+ 1 - 0
src/test/java/scot/carricksoftware/grants/validators/certificates/DivorceCertificateCommandValidatorTest.java

@@ -15,6 +15,7 @@ import org.springframework.validation.BindingResult;
 import scot.carricksoftware.grants.commands.certificates.divorcecertificates.DivorceCertificateCommand;
 import scot.carricksoftware.grants.commands.certificates.divorcecertificates.DivorceCertificateCommandImpl;
 import scot.carricksoftware.grants.domains.people.Person;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.DivorceCertificateCommandValidator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;

+ 1 - 0
src/test/java/scot/carricksoftware/grants/validators/certificates/MarriageCertificateCommandValidatorTest.java

@@ -15,6 +15,7 @@ import org.springframework.validation.BindingResult;
 import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
 import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommandImpl;
 import scot.carricksoftware.grants.domains.people.Person;
+import scot.carricksoftware.grants.validators.certificates.deathcertificate.MarriageCertificateCommandValidator;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;

+ 16 - 0
src/test/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartOneValidatorTest.java

@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
+
+import org.junit.jupiter.api.BeforeEach;
+
+
+class BirthCertificateCommandPartOneValidatorTest {
+
+    @BeforeEach
+    void setUp() {
+    }
+}

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

@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
+
+import org.junit.jupiter.api.BeforeEach;
+
+
+class BirthCertificateCommandPartThreeValidatorTest {
+
+    @BeforeEach
+    void setUp() {
+    }
+}

+ 16 - 0
src/test/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandPartTwoValidatorTest.java

@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
+
+import org.junit.jupiter.api.BeforeEach;
+
+
+class BirthCertificateCommandPartTwoValidatorTest {
+
+    @BeforeEach
+    void setUp() {
+    }
+}

+ 8 - 8
src/test/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandValidatorTest.java → src/test/java/scot/carricksoftware/grants/validators/certificates/birthcertificate/BirthCertificateCommandValidatorImplTest.java

@@ -1,9 +1,9 @@
 /*
- * Copyright (c) Andrew Grant of Carrick Software 19/03/2025, 11:37. All rights reserved.
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
  *
  */
 
-package scot.carricksoftware.grants.validators.certificates;
+package scot.carricksoftware.grants.validators.certificates.birthcertificate;
 
 
 import org.junit.jupiter.api.BeforeEach;
@@ -17,18 +17,18 @@ import scot.carricksoftware.grants.commands.certificates.birthcertificates.Birth
 import static org.mockito.Mockito.verify;
 
 @ExtendWith(MockitoExtension.class)
-class BirthCertificateCommandValidatorTest {
+class BirthCertificateCommandValidatorImplTest {
 
-    private BirthCertificateCommandValidator commandValidator;
+    private BirthCertificateCommandValidatorImpl commandValidator;
 
     @Mock
-    private BirthCertificateCommandPartOneValidator partOneValidatorMock;
+    private BirthCertificateCommandPartOneValidatorImpl partOneValidatorMock;
 
     @Mock
-    private BirthCertificateCommandPartTwoValidator partTwoValidatorMock;
+    private BirthCertificateCommandPartTwoValidatorImpl partTwoValidatorMock;
 
     @Mock
-    private BirthCertificateCommandPartThreeValidator partThreeValidatorMock;
+    private BirthCertificateCommandPartThreeValidatorImpl partThreeValidatorMock;
 
     @Mock
     private BindingResult bindingResultMock;
@@ -38,7 +38,7 @@ class BirthCertificateCommandValidatorTest {
 
     @BeforeEach
     void setUp() {
-        commandValidator = new BirthCertificateCommandValidator(
+        commandValidator = new BirthCertificateCommandValidatorImpl(
                 partOneValidatorMock,
                 partTwoValidatorMock,
                 partThreeValidatorMock);