Ver Fonte

Registered attributes added to domain

Andrew Grant há 5 meses atrás
pai
commit
b891b45c2d

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

@@ -80,6 +80,14 @@ public class BirthCertificate extends BaseCertificate {
     @Column(name = "`informant_qualification`")
     private String informantQualification;
 
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name = "`when_registered`")
+    private String whenRegistered;
+
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name = "`where_registered`")
+    private String whereRegistered;
+
     public Person getNewBorn() {
         return newBorn;
     }
@@ -185,4 +193,20 @@ public class BirthCertificate extends BaseCertificate {
     public void setInformantQualification(String informantQualification) {
         this.informantQualification = informantQualification;
     }
+
+    public String getWhenRegistered() {
+        return whenRegistered;
+    }
+
+    public void setWhenRegistered(String whenRegistered) {
+        this.whenRegistered = whenRegistered;
+    }
+
+    public String getWhereRegistered() {
+        return whereRegistered;
+    }
+
+    public void setWhereRegistered(String whereRegistered) {
+        this.whereRegistered = whereRegistered;
+    }
 }

+ 49 - 0
src/test/java/scot/carricksoftware/grants/domains/certificates/BirthCertificateRegisteredTest.java

@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 24/03/2025, 17:20. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.domains.certificates;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+
+
+class BirthCertificateRegisteredTest {
+
+    private BirthCertificate certificate;
+
+    @BeforeEach
+    void setUp() {
+        certificate = new BirthCertificate();
+    }
+
+    @Test
+    void getWhenRegisteredTest() {
+        assertNull(certificate.getWhenRegistered());
+    }
+
+    @Test
+    void setWhenRegisteredTest() {
+        String whenRegistered = GetRandomString();
+        certificate.setWhenRegistered(whenRegistered);
+        assertEquals(whenRegistered, certificate.getWhenRegistered());
+    }
+
+    @Test
+    void getWhereRegisteredTest() {
+        assertNull(certificate.getWhereRegistered());
+    }
+
+    @Test
+    void setWhereRegisteredTest() {
+        String whereRegistered = GetRandomString();
+        certificate.setWhereRegistered(whereRegistered);
+        assertEquals(whereRegistered, certificate.getWhereRegistered());
+    }
+
+}