Browse Source

MarriageCertificateCertificateConverterTest

Andrew Grant 4 months ago
parent
commit
970e23c850
20 changed files with 426 additions and 158 deletions
  1. 23 34
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/MarriageCertificateConverterImpl.java
  2. 15 0
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateBrideConverter.java
  3. 29 0
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateBrideConverterImpl.java
  4. 15 0
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateCertificateConverter.java
  5. 26 0
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateCertificateConverterImpl.java
  6. 15 0
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateGroomConverter.java
  7. 27 0
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateGroomConverterImpl.java
  8. 15 0
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateWitnessConverter.java
  9. 24 0
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateWitnessConverterImpl.java
  10. 8 8
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateBrideCommandConverterImpl.java
  11. 6 6
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateCertificateCommandConverterImpl.java
  12. 8 8
      src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateGroomCommandConverterImpl.java
  13. 36 89
      src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/MarriageCertificateConverterTest.java
  14. 8 10
      src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateBrideConverterTest.java
  15. 56 0
      src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateCertificateConverterTest.java
  16. 64 0
      src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateGroomConverterTest.java
  17. 48 0
      src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateWitnessConverterTest.java
  18. 1 1
      src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateCertificateConverterCommandTest.java
  19. 1 1
      src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateGroomConverterCommandTest.java
  20. 1 1
      src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateWitnessConverterCommandTest.java

+ 23 - 34
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/MarriageCertificateConverterImpl.java

@@ -8,6 +8,10 @@ package scot.carricksoftware.grants.converters.certificates.marriagecertificates
 import org.springframework.stereotype.Component;
 import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
 import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommandImpl;
+import scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate.MarriageCertificateBrideConverter;
+import scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate.MarriageCertificateCertificateConverter;
+import scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate.MarriageCertificateGroomConverter;
+import scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate.MarriageCertificateWitnessConverter;
 import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
 
 @SuppressWarnings("unused")
@@ -15,43 +19,28 @@ import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
 @Component
 public class MarriageCertificateConverterImpl implements MarriageCertificateConverter {
 
+    private final MarriageCertificateBrideConverter brideConverter;
+    private final MarriageCertificateGroomConverter groomConverter;
+    private final MarriageCertificateWitnessConverter witnessConverter;
+    private final MarriageCertificateCertificateConverter certificateConverter;
+
+    public MarriageCertificateConverterImpl(MarriageCertificateBrideConverter brideConverter,
+                                            MarriageCertificateGroomConverter groomConverter,
+                                            MarriageCertificateWitnessConverter witnessConverter,
+                                            MarriageCertificateCertificateConverter certificateConverter) {
+        this.brideConverter = brideConverter;
+        this.groomConverter = groomConverter;
+        this.witnessConverter = witnessConverter;
+        this.certificateConverter = certificateConverter;
+    }
+
     @Override
     public MarriageCertificateCommand convert(MarriageCertificate source) {
         MarriageCertificateCommand target = new MarriageCertificateCommandImpl();
-
-        target.setBride(source.getBride());
-        target.setBrideAge(source.getBrideAge());
-        target.setBrideCondition(source.getBrideCondition());
-        target.setBrideFather(source.getBrideFather());
-        target.setBrideFatherRank(source.getBrideFatherRank());
-        target.setBrideRank(source.getBrideRank());
-        target.setBrideUntrackedFather(source.getBrideUntrackedFather());
-        target.setBrideUntrackedResidence(source.getBrideUntrackedResidence());
-        target.setBrideUsualResidence(source.getBrideUsualResidence());
-        target.setCertificateDate(source.getCertificateDate());
-        target.setCertificateNumber(source.getCertificateNumber());
-        target.setCertificateSource(source.getCertificateSource());
-        target.setCertificateType(source.getCertificateType());
-        target.setFirstWitness(source.getFirstWitness());
-        target.setGroom(source.getGroom());
-        target.setGroomAge(source.getGroomAge());
-        target.setGroomCondition(source.getGroomCondition());
-        target.setGroomFather(source.getGroomFather());
-        target.setGroomFatherRank(source.getGroomFatherRank());
-        target.setGroomRank(source.getGroomRank());
-        target.setGroomUntrackedFather(source.getGroomUntrackedFather());
-        target.setGroomUntrackedResidence(source.getGroomUntrackedResidence());
-        target.setGroomUsualResidence(source.getGroomUsualResidence());
-        target.setId(source.getId());
-        target.setNumber(source.getNumber());
-        target.setRegistrationAuthority(source.getRegistrationAuthority());
-        target.setSecondWitness(source.getSecondWitness());
-        target.setUntrackedFirstWitness(source.getUntrackedFirstWitness());
-        target.setUntrackedSecondWitness(source.getUntrackedSecondWitness());
-        target.setUntrackedWhereMarried(source.getUntrackedWhereMarried());
-        target.setVolume(source.getVolume());
-        target.setWhenMarried(source.getWhenMarried());
-        target.setWhereMarried(source.getWhereMarried());
+        brideConverter.convert(source, target);
+        groomConverter.convert(source, target);
+        witnessConverter.convert(source, target);
+        certificateConverter.convert(source, target);
 
         return target;
     }

+ 15 - 0
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateBrideConverter.java

@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
+
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+public interface MarriageCertificateBrideConverter {
+
+    void convert(MarriageCertificate source, MarriageCertificateCommand target);
+
+}

+ 29 - 0
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateBrideConverterImpl.java

@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
+
+import org.springframework.stereotype.Component;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+@Component
+public class MarriageCertificateBrideConverterImpl implements MarriageCertificateBrideConverter {
+
+    @Override
+    public void convert(MarriageCertificate source, MarriageCertificateCommand target) {
+
+        target.setBride(source.getBride());
+        target.setBrideAge(source.getBrideAge());
+        target.setBrideCondition(source.getBrideCondition());
+        target.setBrideFather(source.getBrideFather());
+        target.setBrideFatherRank(source.getBrideFatherRank());
+        target.setBrideRank(source.getBrideRank());
+        target.setBrideUntrackedFather(source.getBrideUntrackedFather());
+        target.setBrideUntrackedResidence(source.getBrideUntrackedResidence());
+        target.setBrideUsualResidence(source.getBrideUsualResidence());
+
+    }
+}

+ 15 - 0
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateCertificateConverter.java

@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
+
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+public interface MarriageCertificateCertificateConverter {
+
+    void convert(MarriageCertificate source, MarriageCertificateCommand target);
+
+}

+ 26 - 0
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateCertificateConverterImpl.java

@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
+
+import org.springframework.stereotype.Component;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+@Component
+public class MarriageCertificateCertificateConverterImpl implements MarriageCertificateCertificateConverter {
+
+    @Override
+    public void convert(MarriageCertificate source, MarriageCertificateCommand target) {
+
+        target.setId(source.getId());
+        target.setNumber(source.getNumber());
+        target.setRegistrationAuthority(source.getRegistrationAuthority());
+        target.setUntrackedWhereMarried(source.getUntrackedWhereMarried());
+        target.setVolume(source.getVolume());
+        target.setWhenMarried(source.getWhenMarried());
+        target.setWhereMarried(source.getWhereMarried());
+    }
+}

+ 15 - 0
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateGroomConverter.java

@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
+
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+public interface MarriageCertificateGroomConverter {
+
+    void convert(MarriageCertificate source, MarriageCertificateCommand target);
+
+}

+ 27 - 0
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateGroomConverterImpl.java

@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
+
+import org.springframework.stereotype.Component;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+@Component
+public class MarriageCertificateGroomConverterImpl implements MarriageCertificateGroomConverter {
+
+    @Override
+    public void convert(MarriageCertificate source, MarriageCertificateCommand target) {
+        target.setGroom(source.getGroom());
+        target.setGroomAge(source.getGroomAge());
+        target.setGroomCondition(source.getGroomCondition());
+        target.setGroomFather(source.getGroomFather());
+        target.setGroomFatherRank(source.getGroomFatherRank());
+        target.setGroomRank(source.getGroomRank());
+        target.setGroomUntrackedFather(source.getGroomUntrackedFather());
+        target.setGroomUntrackedResidence(source.getGroomUntrackedResidence());
+        target.setGroomUsualResidence(source.getGroomUsualResidence());
+    }
+}

+ 15 - 0
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateWitnessConverter.java

@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
+
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+public interface MarriageCertificateWitnessConverter {
+
+    void convert(MarriageCertificate source, MarriageCertificateCommand target);
+
+}

+ 24 - 0
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateWitnessConverterImpl.java

@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
+
+import org.springframework.stereotype.Component;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+@Component
+public class MarriageCertificateWitnessConverterImpl implements MarriageCertificateWitnessConverter {
+
+    @Override
+    public void convert(MarriageCertificate source, MarriageCertificateCommand target) {
+
+        target.setFirstWitness(source.getFirstWitness());
+        target.setSecondWitness(source.getSecondWitness());
+        target.setUntrackedFirstWitness(source.getUntrackedFirstWitness());
+        target.setUntrackedSecondWitness(source.getUntrackedSecondWitness());
+
+    }
+}

+ 8 - 8
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateBrideCommandConverterImpl.java

@@ -15,15 +15,15 @@ public class MarriageCertificateBrideCommandConverterImpl implements MarriageCer
     @Override
     public void convert(MarriageCertificateCommand source, MarriageCertificate target) {
 
-        target.setBride(source.getBride());
-        target.setBrideAge(source.getBrideAge());
-        target.setBrideCondition(source.getBrideCondition());
-        target.setBrideFather(source.getBrideFather());
-        target.setBrideFatherRank(source.getBrideFatherRank());
-        target.setBrideRank(source.getBrideRank());
-        target.setBrideUntrackedFather(source.getBrideUntrackedFather());
-        target.setBrideUntrackedResidence(source.getBrideUntrackedResidence());
         target.setBrideUsualResidence(source.getBrideUsualResidence());
+        target.setBrideUntrackedResidence(source.getBrideUntrackedResidence());
+        target.setBrideUntrackedFather(source.getBrideUntrackedFather());
+        target.setBrideRank(source.getBrideRank());
+        target.setBrideFatherRank(source.getBrideFatherRank());
+        target.setBrideFather(source.getBrideFather());
+        target.setBrideCondition(source.getBrideCondition());
+        target.setBrideAge(source.getBrideAge());
+        target.setBride(source.getBride());
 
     }
 }

+ 6 - 6
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateCertificateCommandConverterImpl.java

@@ -15,12 +15,12 @@ public class MarriageCertificateCertificateCommandConverterImpl implements Marri
     @Override
     public void convert(MarriageCertificateCommand source, MarriageCertificate target) {
 
-        target.setId(source.getId());
-        target.setNumber(source.getNumber());
-        target.setRegistrationAuthority(source.getRegistrationAuthority());
-        target.setUntrackedWhereMarried(source.getUntrackedWhereMarried());
-        target.setVolume(source.getVolume());
-        target.setWhenMarried(source.getWhenMarried());
         target.setWhereMarried(source.getWhereMarried());
+        target.setWhenMarried(source.getWhenMarried());
+        target.setVolume(source.getVolume());
+        target.setUntrackedWhereMarried(source.getUntrackedWhereMarried());
+        target.setRegistrationAuthority(source.getRegistrationAuthority());
+        target.setNumber(source.getNumber());
+        target.setId(source.getId());
     }
 }

+ 8 - 8
src/main/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateGroomCommandConverterImpl.java

@@ -14,14 +14,14 @@ public class MarriageCertificateGroomCommandConverterImpl implements MarriageCer
 
     @Override
     public void convert(MarriageCertificateCommand source, MarriageCertificate target) {
-        target.setGroom(source.getGroom());
-        target.setGroomAge(source.getGroomAge());
-        target.setGroomCondition(source.getGroomCondition());
-        target.setGroomFather(source.getGroomFather());
-        target.setGroomFatherRank(source.getGroomFatherRank());
-        target.setGroomRank(source.getGroomRank());
-        target.setGroomUntrackedFather(source.getGroomUntrackedFather());
-        target.setGroomUntrackedResidence(source.getGroomUntrackedResidence());
         target.setGroomUsualResidence(source.getGroomUsualResidence());
+        target.setGroomUntrackedResidence(source.getGroomUntrackedResidence());
+        target.setGroomUntrackedFather(source.getGroomUntrackedFather());
+        target.setGroomRank(source.getGroomRank());
+        target.setGroomFatherRank(source.getGroomFatherRank());
+        target.setGroomFather(source.getGroomFather());
+        target.setGroomCondition(source.getGroomCondition());
+        target.setGroomAge(source.getGroomAge());
+        target.setGroom(source.getGroom());
     }
 }

+ 36 - 89
src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/MarriageCertificateConverterTest.java

@@ -8,108 +8,55 @@ package scot.carricksoftware.grants.converters.certificates.marriagecertificates
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
 import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate.MarriageCertificateBrideConverter;
+import scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate.MarriageCertificateCertificateConverter;
+import scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate.MarriageCertificateGroomConverter;
+import scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate.MarriageCertificateWitnessConverter;
 import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
-import scot.carricksoftware.grants.enums.certificates.CertificateType;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
-import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
-import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
-import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
-import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
+import static org.mockito.Mockito.verify;
 
+@ExtendWith(MockitoExtension.class)
 class MarriageCertificateConverterTest {
 
     private MarriageCertificateConverter converter;
 
-    @BeforeEach
-    void setUp() {
-        converter = new MarriageCertificateConverterImpl();
-    }
+    @Mock
+    private MarriageCertificateBrideConverter marriageCertificateBrideConverterMock;
 
-    @Test
-    void convertTest() {
-        MarriageCertificate source = new MarriageCertificate();
-
-        source.setId(GetRandomLong());
-        source.setBride(GetRandomPerson());
-        source.setGroom(GetRandomPerson());
-        source.setGroomUsualResidence(GetRandomPlace());
-        source.setBrideUsualResidence(GetRandomPlace());
-        source.setGroomUntrackedResidence(GetRandomString());
-        source.setBrideUntrackedResidence(GetRandomString());
-        source.setGroomFather(GetRandomPerson());
-        source.setBrideFather(GetRandomPerson());
-        source.setGroomUntrackedFather(GetRandomString());
-        source.setBrideUntrackedFather(GetRandomString());
-        source.setBrideFatherRank(GetRandomString());
-        source.setGroomFatherRank(GetRandomString());
-        source.setFirstWitness(GetRandomPerson());
-        source.setSecondWitness(GetRandomPerson());
-        source.setUntrackedFirstWitness(GetRandomString());
-        source.setUntrackedSecondWitness(GetRandomString());
-        source.setWhenMarried(GetRandomString());
-        source.setWhereMarried(GetRandomPlace());
-        source.setUntrackedWhereMarried(GetRandomString());
-        source.setGroomAge(GetRandomString());
-        source.setBrideAge(GetRandomString());
-        source.setGroomCondition(GetRandomString());
-        source.setBrideCondition(GetRandomString());
-        source.setGroomRank(GetRandomString());
-        source.setBrideRank(GetRandomString());
-        source.setCertificateNumber(GetRandomString());
-        source.setCertificateType(CertificateType.EXTRACT);
-        source.setCertificateSource(GetRandomOrganisation());
-        source.setCertificateDate(GetRandomString());
-        source.setRegistrationAuthority(GetRandomOrganisation());
-        source.setVolume(GetRandomString());
-        source.setNumber(GetRandomString());
+    @Mock
+    private MarriageCertificateGroomConverter marriageCertificateGroomConverterMock;
 
-        MarriageCertificateCommand target = converter.convert(source);
+    @Mock
+    private MarriageCertificateWitnessConverter marriageCertificateWitnessConverterMock;
 
-        assert target != null;
-        assertEquals(source.getId(), target.getId());
-        assertEquals(source.getBride(), target.getBride());
-        assertEquals(source.getGroom(), target.getGroom());
-        assertEquals(source.getGroomUsualResidence(), target.getGroomUsualResidence());
-        assertEquals(source.getBrideUsualResidence(), target.getBrideUsualResidence());
-        assertEquals(source.getGroomUntrackedResidence(), target.getGroomUntrackedResidence());
-        assertEquals(source.getBrideUntrackedResidence(), target.getBrideUntrackedResidence());
-        assertEquals(source.getGroomFather(), target.getGroomFather());
-        assertEquals(source.getBrideFather(), target.getBrideFather());
-        assertEquals(source.getGroomUntrackedFather(), target.getGroomUntrackedFather());
-        assertEquals(source.getBrideUntrackedFather(), target.getBrideUntrackedFather());
-        assertEquals(source.getGroomRank(), target.getGroomRank());
-        assertEquals(source.getBrideRank(), target.getBrideRank());
-        assertEquals(source.getBrideFatherRank(), target.getBrideFatherRank());
-        assertEquals(source.getGroomFatherRank(), target.getGroomFatherRank());
-        assertEquals(source.getFirstWitness(), target.getFirstWitness());
-        assertEquals(source.getSecondWitness(), target.getSecondWitness());
-        assertEquals(source.getWhereMarried(), target.getWhereMarried());
-        assertEquals(source.getWhereMarried(), target.getWhereMarried());
-        assertEquals(source.getUntrackedWhereMarried(), target.getUntrackedWhereMarried());
-        assertEquals(source.getGroomAge(), target.getGroomAge());
-        assertEquals(source.getBrideAge(), target.getBrideAge());
-        assertEquals(source.getGroomCondition(), target.getGroomCondition());
-        assertEquals(source.getBrideCondition(), target.getBrideCondition());
-        assertEquals(source.getGroomRank(), target.getGroomRank());
-        assertEquals(source.getBrideRank(), target.getBrideRank());
-        assertEquals(source.getFirstWitness(), target.getFirstWitness());
-        assertEquals(source.getSecondWitness(), target.getSecondWitness());
-        assertEquals(source.getUntrackedFirstWitness(), target.getUntrackedFirstWitness());
-        assertEquals(source.getUntrackedSecondWitness(), target.getUntrackedSecondWitness());
-        assertEquals(source.getWhereMarried(), target.getWhereMarried());
-        assertEquals(source.getWhenMarried(), target.getWhenMarried());
+    @Mock
+    private MarriageCertificateCertificateConverter marriageCertificateCertificateConverterMock;
 
-        assertEquals(source.getCertificateNumber(), target.getCertificateNumber());
-        assertEquals(source.getCertificateType(), target.getCertificateType());
-        assertEquals(source.getCertificateSource(), target.getCertificateSource());
-        assertEquals(source.getCertificateDate(), target.getCertificateDate());
-        assertEquals(source.getRegistrationAuthority(), target.getRegistrationAuthority());
-        assertEquals(source.getVolume(), target.getVolume());
-        assertEquals(source.getNumber(), target.getNumber());
+    private MarriageCertificate marriageCertificate;
 
+    @BeforeEach
+    void setUp() {
+        converter = new MarriageCertificateConverterImpl(
+                marriageCertificateBrideConverterMock,
+                marriageCertificateGroomConverterMock,
+                marriageCertificateWitnessConverterMock,
+                marriageCertificateCertificateConverterMock);
+        marriageCertificate = new MarriageCertificate();
+    }
 
+    @Test
+    void helpersGetCalledTest() {
+        MarriageCertificateCommand certificateCommand = converter.convert(marriageCertificate);
+        verify(marriageCertificateBrideConverterMock).convert(marriageCertificate, certificateCommand);
+        verify(marriageCertificateGroomConverterMock).convert(marriageCertificate, certificateCommand);
+        verify(marriageCertificateWitnessConverterMock).convert(marriageCertificate, certificateCommand);
+        verify(marriageCertificateCertificateConverterMock).convert(marriageCertificate, certificateCommand);
     }
+
+
 }

+ 8 - 10
src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/MarriageCertificateBrideCommandConverterTest.java → src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateBrideConverterTest.java

@@ -3,15 +3,13 @@
  *
  */
 
-package scot.carricksoftware.grants.converters.certificates.marriagecertificates;
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
 
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
 import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommandImpl;
-import scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.command.MarriageCertificateBrideCommandConverter;
-import scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.command.MarriageCertificateBrideCommandConverterImpl;
 import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -19,18 +17,18 @@ import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRan
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
 import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
 
-class MarriageCertificateBrideCommandConverterTest {
+class MarriageCertificateBrideConverterTest {
 
-    private MarriageCertificateBrideCommandConverter converter;
+    private MarriageCertificateBrideConverter converter;
    
-    private MarriageCertificateCommand source;
-    private MarriageCertificate target;
+    private MarriageCertificate source;
+    private MarriageCertificateCommand target;
 
     @BeforeEach
     void setUp() {
-        converter = new MarriageCertificateBrideCommandConverterImpl();
-        source = new MarriageCertificateCommandImpl();
-        target = new MarriageCertificate();
+        converter = new MarriageCertificateBrideConverterImpl();
+        source = new MarriageCertificate();
+        target = new MarriageCertificateCommandImpl();
     }
 
     @Test

+ 56 - 0
src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateCertificateConverterTest.java

@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
+
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommandImpl;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
+
+class MarriageCertificateCertificateConverterTest {
+
+    private MarriageCertificateCertificateConverter converter;
+   
+    private MarriageCertificate source;
+    private MarriageCertificateCommand target;
+
+    @BeforeEach
+    void setUp() {
+        converter = new MarriageCertificateCertificateConverterImpl();
+        source = new MarriageCertificate();
+        target = new MarriageCertificateCommandImpl();
+    }
+
+    @Test
+    void convertTest() {
+        source.setId(GetRandomLong());
+        source.setNumber(GetRandomString());
+        source.setRegistrationAuthority(GetRandomOrganisation());
+        source.setUntrackedWhereMarried(GetRandomString());
+        source.setVolume(GetRandomString());
+        source.setWhenMarried(GetRandomString());
+        source.setWhereMarried(GetRandomPlace());
+
+        converter.convert(source, target);
+
+        assertEquals(source.getId(),target.getId());
+        assertEquals(source.getNumber(),target.getNumber());
+        assertEquals(source.getRegistrationAuthority(),target.getRegistrationAuthority());
+        assertEquals(source.getUntrackedWhereMarried(),target.getUntrackedWhereMarried());
+        assertEquals(source.getVolume(),target.getVolume());
+        assertEquals(source.getWhenMarried(),target.getWhenMarried());
+        assertEquals(source.getWhereMarried(),target.getWhereMarried());
+    }
+
+}

+ 64 - 0
src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateGroomConverterTest.java

@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
+
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommandImpl;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
+
+class MarriageCertificateGroomConverterTest {
+
+    private MarriageCertificateGroomConverter converter;
+   
+    private MarriageCertificate source;
+    private MarriageCertificateCommand target;
+
+    @BeforeEach
+    void setUp() {
+        converter = new MarriageCertificateGroomConverterImpl();
+        source = new MarriageCertificate();
+        target = new MarriageCertificateCommandImpl();
+    }
+
+    @Test
+    void convertTest() {
+        source.setGroom(GetRandomPerson());
+        source.setGroomUsualResidence(GetRandomPlace());
+        source.setGroomAge(GetRandomString());
+        source.setGroomCondition(GetRandomString());
+        source.setGroomFather(GetRandomPerson());
+        source.setGroomFatherRank(GetRandomString());
+        source.setGroomRank(GetRandomString());
+        source.setGroomUntrackedFather(GetRandomString());
+        source.setGroomUntrackedResidence(GetRandomString());
+        source.setGroomUsualResidence(GetRandomPlace());
+
+        converter.convert(source, target);
+
+        assertEquals(source.getGroom(),target.getGroom());
+        assertEquals(source.getGroomUsualResidence(),target.getGroomUsualResidence());
+        assertEquals(source.getGroomAge(),target.getGroomAge());
+        assertEquals(source.getGroomCondition(),target.getGroomCondition());
+        assertEquals(source.getGroomFather(),target.getGroomFather());
+        assertEquals(source.getGroomFatherRank(),target.getGroomFatherRank());
+        assertEquals(source.getGroomRank(),target.getGroomRank());
+        assertEquals(source.getGroomUntrackedFather(),target.getGroomUntrackedFather());
+        assertEquals(source.getGroomUntrackedResidence(),target.getGroomUntrackedResidence());
+        assertEquals(source.getGroomUsualResidence(),target.getGroomUsualResidence());
+        
+  
+
+    }
+
+}

+ 48 - 0
src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/certificate/MarriageCertificateWitnessConverterTest.java

@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.certificate;
+
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommandImpl;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
+
+class MarriageCertificateWitnessConverterTest {
+
+    private MarriageCertificateWitnessConverter converter;
+   
+    private MarriageCertificate source;
+    private MarriageCertificateCommand target;
+
+    @BeforeEach
+    void setUp() {
+        converter = new MarriageCertificateWitnessConverterImpl();
+        source = new MarriageCertificate();
+        target = new MarriageCertificateCommandImpl();
+    }
+
+    @Test
+    void convertTest() {
+        source.setFirstWitness(GetRandomPerson());
+        source.setSecondWitness(GetRandomPerson());
+        source.setUntrackedFirstWitness(GetRandomString());
+        source.setUntrackedSecondWitness(GetRandomString());
+
+        converter.convert(source, target);
+
+        assertEquals(source.getFirstWitness(),target.getFirstWitness());
+        assertEquals(source.getSecondWitness(),target.getSecondWitness());
+        assertEquals(source.getUntrackedFirstWitness(),target.getUntrackedFirstWitness());
+        assertEquals(source.getUntrackedSecondWitness(),target.getUntrackedSecondWitness());
+    }
+
+}

+ 1 - 1
src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateCertificateCommandConverterTest.java → src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateCertificateConverterCommandTest.java

@@ -18,7 +18,7 @@ import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLo
 import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
 import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
 
-class MarriageCertificateCertificateCommandConverterTest {
+class MarriageCertificateCertificateConverterCommandTest {
 
     private MarriageCertificateCertificateCommandConverter converter;
    

+ 1 - 1
src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateGroomCommandConverterTest.java → src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateGroomConverterCommandTest.java

@@ -17,7 +17,7 @@ import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRan
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
 import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
 
-class MarriageCertificateGroomCommandConverterTest {
+class MarriageCertificateGroomConverterCommandTest {
 
     private MarriageCertificateGroomCommandConverter converter;
    

+ 1 - 1
src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateWitnessCommandConverterTest.java → src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateWitnessConverterCommandTest.java

@@ -16,7 +16,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
 
-class MarriageCertificateWitnessCommandConverterTest {
+class MarriageCertificateWitnessConverterCommandTest {
 
     private MarriageCertificateWitnessCommandConverter converter;