Browse Source

Person command image added

Andrew Grant 2 months ago
parent
commit
a52fe705d3

+ 5 - 0
src/main/java/scot/carricksoftware/grants/commands/people/PersonCommand.java

@@ -10,6 +10,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.text.PersonText;
 
@@ -68,4 +69,8 @@ public interface PersonCommand {
     String getCertifiedYearOfDeath();
 
     void setCertifiedYearOfDeath(String certifiedYearOfDeath);
+
+    Image getImage();
+
+    void setImage(Image image);
 }

+ 12 - 0
src/main/java/scot/carricksoftware/grants/commands/people/PersonCommandImpl.java

@@ -11,6 +11,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.text.PersonText;
 
@@ -46,6 +47,7 @@ public class PersonCommandImpl implements PersonCommand {
 
     private List<PersonText> personTexts = new ArrayList<>();
 
+    private Image image;
 
     public Long getId() {
         return Id;
@@ -174,4 +176,14 @@ public class PersonCommandImpl implements PersonCommand {
     public void setCertifiedYearOfDeath(String certifiedYearOfDeath) {
         this.certifiedYearOfDeath = certifiedYearOfDeath;
     }
+
+    @Override
+    public Image getImage() {
+        return image;
+    }
+
+    @Override
+    public void setImage(Image image) {
+        this.image = image;
+    }
 }

+ 12 - 0
src/test/java/scot/carricksoftware/grants/commands/people/PersonCensusCommandTest.java

@@ -8,6 +8,7 @@ package scot.carricksoftware.grants.commands.people;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grants.domains.images.Image;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNull;
@@ -82,4 +83,15 @@ class PersonCensusCommandTest {
         assertEquals(string, command.getCertifiedYearOfBirth());
     }
 
+    @Test
+    void setImageTest() {
+        Image image = new Image();
+        command.setImage(image);
+    }
+
+    @Test
+    void getImageTest() {
+        assertNull(command.getImage());
+    }
+
 }