浏览代码

Person converter image added

Andrew Grant 2 月之前
父节点
当前提交
881c05bef5

+ 1 - 0
src/main/java/scot/carricksoftware/grants/converters/people/PersonCommandConverterImpl.java

@@ -29,6 +29,7 @@ public class PersonCommandConverterImpl implements PersonCommandConverter {
         result.setDivorceCertificates(source.getDivorceCertificates());
         result.setPersonImages(source.getPersonImages());
         result.setPersonTexts(source.getPersonTexts());
+        result.setImage(source.getImage());
 
         return result;
     }

+ 1 - 0
src/main/java/scot/carricksoftware/grants/converters/people/PersonConverterImpl.java

@@ -31,6 +31,7 @@ public class PersonConverterImpl implements PersonConverter {
         result.setDeathCertificates(source.getDeathCertificates());
         result.setBirthCertificates(source.getBirthCertificates());
         result.setMarriageCertificates(source.getMarriageCertificates());
+        result.setImage(source.getImage());
         return result;
     }
 }

+ 4 - 0
src/test/java/scot/carricksoftware/grants/converters/people/PersonCommandConverterTest.java

@@ -14,6 +14,7 @@ import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
 import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
 import scot.carricksoftware.grants.domains.certificates.DivorceCertificate;
 import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+import scot.carricksoftware.grants.domains.images.Image;
 import scot.carricksoftware.grants.domains.images.PersonImage;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.text.PersonText;
@@ -41,6 +42,7 @@ class PersonCommandConverterTest {
         String certifiedYearOfBirth = GetRandomString();
         String certifiedYearOfDeath = GetRandomString();
         PersonCommand source = new PersonCommandImpl();
+        Image image = new Image();
 
         ArrayList<DivorceCertificate> divorceCertificates = new ArrayList<>();
         divorceCertificates.add(new DivorceCertificate());
@@ -79,6 +81,7 @@ class PersonCommandConverterTest {
         source.setDeathCertificates(deathCertificates);
         source.setBirthCertificates(birthCertificates);
         source.setMarriageCertificates(marriageCertificates);
+        source.setImage(image);
 
 
         Person target = converter.convert(source);
@@ -98,6 +101,7 @@ class PersonCommandConverterTest {
         assertEquals(deathCertificates, target.getDeathCertificates());
         assertEquals(birthCertificates, target.getBirthCertificates());
         assertEquals(marriageCertificates, target.getMarriageCertificates());
+        assertEquals(image, target.getImage());
 
     }
 }

+ 4 - 0
src/test/java/scot/carricksoftware/grants/converters/people/PersonConverterTest.java

@@ -13,6 +13,7 @@ import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
 import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
 import scot.carricksoftware.grants.domains.certificates.DivorceCertificate;
 import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+import scot.carricksoftware.grants.domains.images.Image;
 import scot.carricksoftware.grants.domains.images.PersonImage;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.text.PersonText;
@@ -42,6 +43,7 @@ class PersonConverterTest {
         String recordedYearOfBirth = GetRandomString();
         String certifiedYearOfBirth = GetRandomString();
         String certifiedYearOfDeath = GetRandomString();
+        Image image = new Image();
 
         ArrayList<DivorceCertificate> divorceCertificates = new ArrayList<>();
         divorceCertificates.add(new DivorceCertificate());
@@ -79,6 +81,7 @@ class PersonConverterTest {
         source.setDeathCertificates(deathCertificates);
         source.setBirthCertificates(birthCertificates);
         source.setMarriageCertificates(marriageCertificates);
+        source.setImage(image);
 
 
         PersonCommand target = converter.convert(source);
@@ -98,6 +101,7 @@ class PersonConverterTest {
         assertEquals(deathCertificates, target.getDeathCertificates());
         assertEquals(birthCertificates, target.getBirthCertificates());
         assertEquals(marriageCertificates, target.getMarriageCertificates());
+        assertEquals(image, target.getImage());
 
     }
 }