Browse Source

Certificate Source changed to Organisation

Andrew Grant 6 tháng trước cách đây
mục cha
commit
6232d42e87
16 tập tin đã thay đổi với 72 bổ sung72 xóa
  1. 8 7
      src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadCertificates.java
  2. 3 4
      src/main/java/scot/carricksoftware/grants/commands/certificates/birthcertificates/BirthCertificateCommand.java
  3. 11 10
      src/main/java/scot/carricksoftware/grants/commands/certificates/birthcertificates/BirthCertificateCommandImpl.java
  4. 1 1
      src/main/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateCommandConverterImpl.java
  5. 1 1
      src/main/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateConverterImpl.java
  6. 9 10
      src/main/java/scot/carricksoftware/grants/domains/certificates/BaseCertificate.java
  7. 1 1
      src/main/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandValidator.java
  8. 1 1
      src/main/resources/application.properties
  9. 8 8
      src/test/java/scot/carricksoftware/grants/bootstrap/DataLoadCertificatesTest.java
  10. 5 5
      src/test/java/scot/carricksoftware/grants/commands/certificates/BirthCertificateCommandImplTest.java
  11. 5 5
      src/test/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateCommandConverterTest.java
  12. 5 5
      src/test/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateConverterTest.java
  13. 5 5
      src/test/java/scot/carricksoftware/grants/domains/certificates/BirthCertificateTest.java
  14. 3 3
      src/test/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandValidatorCertificateTest.java
  15. 4 4
      src/test/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandValidatorDateTest.java
  16. 2 2
      src/test/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandValidatorPersonTest.java

+ 8 - 7
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadCertificates.java

@@ -12,11 +12,11 @@ import org.springframework.stereotype.Component;
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommandImpl;
 import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
-import scot.carricksoftware.grants.domains.places.Place;
+import scot.carricksoftware.grants.domains.places.Organisation;
 import scot.carricksoftware.grants.services.certificates.birthcertificates.BirthCertificateService;
 import scot.carricksoftware.grants.services.certificates.deathcertificates.DeathCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.services.places.places.PlaceService;
+import scot.carricksoftware.grants.services.places.organisations.OrganisationService;
 
 @Component
 @Profile("dev")
@@ -27,15 +27,16 @@ public class DataLoadCertificates {
     private final BirthCertificateService birthCertificateService;
     private final DeathCertificateService deathCertificateService;
     private final PersonService personService;
-    private final PlaceService placeService;
+    private final OrganisationService organisationService;
 
     public DataLoadCertificates(BirthCertificateService birthCertificateService,
                                 DeathCertificateService deathCertificateService,
-                                PersonService personService, PlaceService placeService) {
+                                PersonService personService,
+                                OrganisationService organisationService) {
         this.birthCertificateService = birthCertificateService;
         this.deathCertificateService = deathCertificateService;
         this.personService = personService;
-        this.placeService = placeService;
+        this.organisationService = organisationService;
     }
 
 
@@ -50,9 +51,9 @@ public class DataLoadCertificates {
         birthCertificateCommand.setNewBorn(personService.findById(1L));
         birthCertificateCommand.setCertificateDate("25/01/1953");
         birthCertificateCommand.setCertificateNumber("999");
-        Place place = placeService.findById(1L);
+        Organisation organisation = organisationService.findById(1L);
 
-        birthCertificateCommand.setCertificateIssuedAt(place);
+        birthCertificateCommand.setCertificateSource(organisation);
 
         birthCertificateService.saveBirthCertificateCommand(birthCertificateCommand);
 

+ 3 - 4
src/main/java/scot/carricksoftware/grants/commands/certificates/birthcertificates/BirthCertificateCommand.java

@@ -6,11 +6,10 @@
 package scot.carricksoftware.grants.commands.certificates.birthcertificates;
 
 import scot.carricksoftware.grants.domains.people.Person;
-import scot.carricksoftware.grants.domains.places.Place;
+import scot.carricksoftware.grants.domains.places.Organisation;
 
 public interface BirthCertificateCommand {
 
-
     Long getId();
 
     void setId(Long id);
@@ -26,10 +25,10 @@ public interface BirthCertificateCommand {
     void setCertificateNumber(String certificateNumber);
 
     @SuppressWarnings("unused")
-    Place getCertificateIssuedAt();
+    Organisation getCertificateSource();
 
     @SuppressWarnings("unused")
-    void setCertificateIssuedAt(Place certificateIssuedAt);
+    void setCertificateSource(Organisation certificateSource);
 
     @SuppressWarnings("unused")
     String getCertificateDate();

+ 11 - 10
src/main/java/scot/carricksoftware/grants/commands/certificates/birthcertificates/BirthCertificateCommandImpl.java

@@ -6,7 +6,7 @@
 package scot.carricksoftware.grants.commands.certificates.birthcertificates;
 
 import scot.carricksoftware.grants.domains.people.Person;
-import scot.carricksoftware.grants.domains.places.Place;
+import scot.carricksoftware.grants.domains.places.Organisation;
 
 public class BirthCertificateCommandImpl implements BirthCertificateCommand {
 
@@ -16,7 +16,7 @@ public class BirthCertificateCommandImpl implements BirthCertificateCommand {
 
     private String certificateNumber;
 
-    private Place certificateIssuedAt;
+    private Organisation certificateSource;
 
     private String certificateDate;
 
@@ -48,23 +48,24 @@ public class BirthCertificateCommandImpl implements BirthCertificateCommand {
         this.certificateNumber = certificateNumber;
     }
 
+
     @Override
-    public Place getCertificateIssuedAt() {
-        return certificateIssuedAt;
+    public String getCertificateDate() {
+        return certificateDate;
     }
 
     @Override
-    public void setCertificateIssuedAt(Place certificateIssuedAt) {
-        this.certificateIssuedAt = certificateIssuedAt;
+    public void setCertificateDate(String certificateDate) {
+        this.certificateDate = certificateDate;
     }
 
     @Override
-    public String getCertificateDate() {
-        return certificateDate;
+    public Organisation getCertificateSource() {
+        return certificateSource;
     }
 
     @Override
-    public void setCertificateDate(String certificateDate) {
-        this.certificateDate = certificateDate;
+    public void setCertificateSource(Organisation certificateSource) {
+        this.certificateSource = certificateSource;
     }
 }

+ 1 - 1
src/main/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateCommandConverterImpl.java

@@ -20,7 +20,7 @@ public class BirthCertificateCommandConverterImpl implements BirthCertificateCom
         target.setNewBorn(source.getNewBorn());
         target.setCertificateNumber(source.getCertificateNumber());
         target.setCertificateDate(source.getCertificateDate());
-        target.setCertificateIssuedAt(source.getCertificateIssuedAt());
+        target.setCertificateSource(source.getCertificateSource());
 
         return target;
     }

+ 1 - 1
src/main/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateConverterImpl.java

@@ -24,7 +24,7 @@ public class BirthCertificateConverterImpl implements BirthCertificateConverter
 
         target.setCertificateNumber(source.getCertificateNumber());
         target.setCertificateDate(source.getCertificateDate());
-        target.setCertificateIssuedAt(source.getCertificateIssuedAt());
+        target.setCertificateSource(source.getCertificateSource());
 
         return target;
     }

+ 9 - 10
src/main/java/scot/carricksoftware/grants/domains/certificates/BaseCertificate.java

@@ -13,7 +13,7 @@ import jakarta.persistence.MappedSuperclass;
 import org.springframework.format.annotation.DateTimeFormat;
 import scot.carricksoftware.grants.BaseEntity;
 import scot.carricksoftware.grants.constants.ApplicationConstants;
-import scot.carricksoftware.grants.domains.places.Place;
+import scot.carricksoftware.grants.domains.places.Organisation;
 
 
 @MappedSuperclass
@@ -23,8 +23,8 @@ public class BaseCertificate extends BaseEntity {
     private String certificateNumber;
 
     @ManyToOne
-    @JoinColumn(name = "`place_id`")
-    private Place certificateIssuedAt;
+    @JoinColumn(name = "`organisation_id`")
+    private Organisation certificateSource;
 
     @Column(name= "`certificate_date`")
     @DateTimeFormat(pattern = ApplicationConstants.DATE_TIME_FORMAT)
@@ -40,15 +40,10 @@ public class BaseCertificate extends BaseEntity {
         this.certificateNumber = certificateNumber;
     }
 
-    @SuppressWarnings("unused")
-    public Place getCertificateIssuedAt() {
-        return certificateIssuedAt;
+    public Organisation getCertificateSource() {
+        return certificateSource;
     }
 
-    @SuppressWarnings("unused")
-    public void setCertificateIssuedAt(Place certificateIssuedAt) {
-        this.certificateIssuedAt = certificateIssuedAt;
-    }
 
     @SuppressWarnings("unused")
     public String getCertificateDate() {
@@ -59,4 +54,8 @@ public class BaseCertificate extends BaseEntity {
     public void setCertificateDate(String certificateDate) {
         this.certificateDate = certificateDate;
     }
+
+    public void setCertificateSource(Organisation organisation) {
+        this.certificateSource = organisation;
+    }
 }

+ 1 - 1
src/main/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandValidator.java

@@ -52,7 +52,7 @@ public class BirthCertificateCommandValidator {
 
     private void validateCertificateIssuedAt(BirthCertificateCommand birthCertificateCommand, BindingResult bindingResult) {
         logger.debug("Validating birth certificate Certificate Issued At");
-        if (birthCertificateCommand.getCertificateIssuedAt() == null ) {
+        if (birthCertificateCommand.getCertificateSource() == null ) {
             bindingResult.rejectValue("certificateIssuedAt", ApplicationConstants.EMPTY_STRING,
                     null,
                     ValidationConstants.ISSUED_AT_IS_NULL);

+ 1 - 1
src/main/resources/application.properties

@@ -2,7 +2,7 @@ spring.application.name=grants
 server.port=8086
 server.servlet.context-path=/grants
 spring.mvc.format.date=dd-MM-yyyy
-spring.profiles.active=uat
+spring.profiles.active=dev
 logging.level.scot.carricksoftware=trace
 
 

+ 8 - 8
src/test/java/scot/carricksoftware/grants/bootstrap/DataLoadCertificatesTest.java

@@ -9,17 +9,17 @@ import org.mockito.junit.jupiter.MockitoExtension;
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
 import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
 import scot.carricksoftware.grants.domains.people.Person;
-import scot.carricksoftware.grants.domains.places.Place;
+import scot.carricksoftware.grants.domains.places.Organisation;
 import scot.carricksoftware.grants.services.certificates.birthcertificates.BirthCertificateService;
 import scot.carricksoftware.grants.services.certificates.deathcertificates.DeathCertificateService;
 import scot.carricksoftware.grants.services.people.PersonService;
-import scot.carricksoftware.grants.services.places.places.PlaceService;
+import scot.carricksoftware.grants.services.places.organisations.OrganisationService;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
-import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
 
 @ExtendWith(MockitoExtension.class)
 public class DataLoadCertificatesTest {
@@ -36,7 +36,7 @@ public class DataLoadCertificatesTest {
     private PersonService personServiceMock;
 
     @Mock
-    private PlaceService placeServiceMock;
+    private OrganisationService organisationServiceMock;
 
 
     @BeforeEach
@@ -44,15 +44,15 @@ public class DataLoadCertificatesTest {
         dataLoadCertificates = new DataLoadCertificates(birthCertificateServiceMock,
                 deathCertificateServiceMock,
                 personServiceMock,
-                placeServiceMock);
+                organisationServiceMock);
     }
 
     @Test
     public void birthCertificatesAreLoadedTest() {
         Person person = GetRandomPerson();
         when(personServiceMock.findById(1L)).thenReturn(person);
-        Place place = GetRandomPlace();
-        when(placeServiceMock.findById(1L)).thenReturn(place);
+        Organisation organisation = GetRandomOrganisation();
+        when(organisationServiceMock.findById(1L)).thenReturn(organisation);
 
         ArgumentCaptor<BirthCertificateCommand> captor = ArgumentCaptor.forClass(BirthCertificateCommand.class);
 
@@ -60,7 +60,7 @@ public class DataLoadCertificatesTest {
 
         verify(birthCertificateServiceMock).saveBirthCertificateCommand(captor.capture());
         assertEquals(person, captor.getValue().getNewBorn());
-        assertEquals(place, captor.getValue().getCertificateIssuedAt());
+        assertEquals(organisation, captor.getValue().getCertificateSource());
         assertEquals("999", captor.getValue().getCertificateNumber());
         assertEquals("25/01/1953", captor.getValue().getCertificateDate());
     }

+ 5 - 5
src/test/java/scot/carricksoftware/grants/commands/certificates/BirthCertificateCommandImplTest.java

@@ -10,14 +10,14 @@ import org.junit.jupiter.api.Test;
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommandImpl;
 import scot.carricksoftware.grants.domains.people.Person;
-import scot.carricksoftware.grants.domains.places.Place;
+import scot.carricksoftware.grants.domains.places.Organisation;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNull;
 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.GetRandomPlace;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
 
 class BirthCertificateCommandImplTest {
 
@@ -77,9 +77,9 @@ class BirthCertificateCommandImplTest {
 
     @Test
     void getCertificateIssuedAtTest() {
-        Place place = GetRandomPlace();
-        command.setCertificateIssuedAt(place);
-        assertEquals(place, command.getCertificateIssuedAt());
+        Organisation certificateSource = GetRandomOrganisation();
+        command.setCertificateSource(certificateSource);
+        assertEquals(certificateSource, command.getCertificateSource());
     }
 
 

+ 5 - 5
src/test/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateCommandConverterTest.java

@@ -12,13 +12,13 @@ import scot.carricksoftware.grants.commands.certificates.birthcertificates.Birth
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommandImpl;
 import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
 import scot.carricksoftware.grants.domains.people.Person;
-import scot.carricksoftware.grants.domains.places.Place;
+import scot.carricksoftware.grants.domains.places.Organisation;
 
 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.GetRandomPlace;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
 
 class BirthCertificateCommandConverterTest {
 
@@ -34,7 +34,7 @@ class BirthCertificateCommandConverterTest {
         Long id = GetRandomLong();
         Person person = GetRandomPerson();
         BirthCertificateCommand source = new BirthCertificateCommandImpl();
-        Place issuedAt = GetRandomPlace();
+        Organisation issuedAt = GetRandomOrganisation();
         String certificateNumber = GetRandomString();
         String certificateDate = GetRandomString();
 
@@ -42,7 +42,7 @@ class BirthCertificateCommandConverterTest {
         source.setNewBorn(person);
         source.setCertificateNumber(certificateNumber);
         source.setCertificateDate(certificateDate);
-        source.setCertificateIssuedAt(issuedAt);
+        source.setCertificateSource(issuedAt);
 
 
         BirthCertificate target = converter.convert(source);
@@ -52,7 +52,7 @@ class BirthCertificateCommandConverterTest {
         assertEquals(person, target.getNewBorn());
         assertEquals(certificateNumber, target.getCertificateNumber());
         assertEquals(certificateDate, target.getCertificateDate());
-        assertEquals(issuedAt, target.getCertificateIssuedAt());
+        assertEquals(issuedAt, target.getCertificateSource());
 
     }
 }

+ 5 - 5
src/test/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateConverterTest.java

@@ -11,13 +11,13 @@ import org.junit.jupiter.api.Test;
 import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
 import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
 import scot.carricksoftware.grants.domains.people.Person;
-import scot.carricksoftware.grants.domains.places.Place;
+import scot.carricksoftware.grants.domains.places.Organisation;
 
 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.GetRandomPlace;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
 
 class BirthCertificateConverterTest {
 
@@ -33,7 +33,7 @@ class BirthCertificateConverterTest {
         Long id = GetRandomLong();
         Person person = GetRandomPerson();
         BirthCertificate source = new BirthCertificate();
-        Place issuedAt = GetRandomPlace();
+        Organisation certificateSource = GetRandomOrganisation();
         String certificateNumber = GetRandomString();
         String certificateDate = GetRandomString();
 
@@ -41,7 +41,7 @@ class BirthCertificateConverterTest {
         source.setNewBorn(person);
         source.setCertificateNumber(certificateNumber);
         source.setCertificateDate(certificateDate);
-        source.setCertificateIssuedAt(issuedAt);
+        source.setCertificateSource(certificateSource);
 
 
         BirthCertificateCommand target = converter.convert(source);
@@ -51,7 +51,7 @@ class BirthCertificateConverterTest {
         assertEquals(person, target.getNewBorn());
         assertEquals(certificateNumber, target.getCertificateNumber());
         assertEquals(certificateDate, target.getCertificateDate());
-        assertEquals(issuedAt, target.getCertificateIssuedAt());
+        assertEquals(certificateSource, target.getCertificateSource());
 
     }
 }

+ 5 - 5
src/test/java/scot/carricksoftware/grants/domains/certificates/BirthCertificateTest.java

@@ -8,14 +8,14 @@ package scot.carricksoftware.grants.domains.certificates;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import scot.carricksoftware.grants.domains.people.Person;
-import scot.carricksoftware.grants.domains.places.Place;
+import scot.carricksoftware.grants.domains.places.Organisation;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNull;
 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.GetRandomPlace;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
 
 class BirthCertificateTest {
 
@@ -76,8 +76,8 @@ class BirthCertificateTest {
 
     @Test
     void getCertificateIssuedAtTest() {
-        Place place = GetRandomPlace();
-        certificate.setCertificateIssuedAt(place);
-        assertEquals(place, certificate.getCertificateIssuedAt());
+        Organisation organisation = GetRandomOrganisation();
+        certificate.setCertificateSource(organisation);
+        assertEquals(organisation, certificate.getCertificateSource());
     }
 }

+ 3 - 3
src/test/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandValidatorCertificateTest.java

@@ -21,7 +21,7 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
-import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
 
 @ExtendWith(MockitoExtension.class)
 class BirthCertificateCommandValidatorCertificateTest {
@@ -53,7 +53,7 @@ class BirthCertificateCommandValidatorCertificateTest {
     public void certificateNumberTest() {
         birthCertificateCommand.setNewBorn(GetRandomPerson());
         birthCertificateCommand.setCertificateDate("25/01/1953");
-        birthCertificateCommand.setCertificateIssuedAt(GetRandomPlace());
+        birthCertificateCommand.setCertificateSource(GetRandomOrganisation());
 
         commandValidator.validate(birthCertificateCommand, bindingResultMock);
 
@@ -89,7 +89,7 @@ class BirthCertificateCommandValidatorCertificateTest {
         birthCertificateCommand.setNewBorn(GetRandomPerson());
         birthCertificateCommand.setCertificateNumber(GetRandomString());
         birthCertificateCommand.setCertificateDate(GetRandomString());
-        birthCertificateCommand.setCertificateIssuedAt(GetRandomPlace());
+        birthCertificateCommand.setCertificateSource(GetRandomOrganisation());
 
         when(bindingResultMock.hasErrors()).thenReturn(false);
         commandValidator.validate(birthCertificateCommand, bindingResultMock);

+ 4 - 4
src/test/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandValidatorDateTest.java

@@ -21,7 +21,7 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
-import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
 
 @ExtendWith(MockitoExtension.class)
 class BirthCertificateCommandValidatorDateTest {
@@ -55,7 +55,7 @@ class BirthCertificateCommandValidatorDateTest {
         birthCertificateCommand.setNewBorn(GetRandomPerson());
         birthCertificateCommand.setCertificateNumber(GetRandomString());
         birthCertificateCommand.setCertificateDate(GetRandomString());
-        birthCertificateCommand.setCertificateIssuedAt(GetRandomPlace());
+        birthCertificateCommand.setCertificateSource(GetRandomOrganisation());
 
         when(bindingResultMock.hasErrors()).thenReturn(false);
         commandValidator.validate(birthCertificateCommand, bindingResultMock);
@@ -74,7 +74,7 @@ class BirthCertificateCommandValidatorDateTest {
         birthCertificateCommand.setNewBorn(GetRandomPerson());
         birthCertificateCommand.setCertificateNumber(GetRandomString());
         birthCertificateCommand.setCertificateDate("01/01/2099");
-        birthCertificateCommand.setCertificateIssuedAt(GetRandomPlace());
+        birthCertificateCommand.setCertificateSource(GetRandomOrganisation());
 
         when(bindingResultMock.hasErrors()).thenReturn(false);
         commandValidator.validate(birthCertificateCommand, bindingResultMock);
@@ -92,7 +92,7 @@ class BirthCertificateCommandValidatorDateTest {
     public void certificateNullDateTest() {
         birthCertificateCommand.setNewBorn(GetRandomPerson());
         birthCertificateCommand.setCertificateNumber(GetRandomString());
-        birthCertificateCommand.setCertificateIssuedAt(GetRandomPlace());
+        birthCertificateCommand.setCertificateSource(GetRandomOrganisation());
 
         when(bindingResultMock.hasErrors()).thenReturn(false);
         commandValidator.validate(birthCertificateCommand, bindingResultMock);

+ 2 - 2
src/test/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandValidatorPersonTest.java

@@ -22,7 +22,7 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
-import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
 
 @ExtendWith(MockitoExtension.class)
 class BirthCertificateCommandValidatorPersonTest {
@@ -50,7 +50,7 @@ class BirthCertificateCommandValidatorPersonTest {
         birthCertificateCommand = new BirthCertificateCommandImpl();
         birthCertificateCommand.setCertificateDate("25/01/1953");
         birthCertificateCommand.setCertificateNumber("1953");
-        birthCertificateCommand.setCertificateIssuedAt(GetRandomPlace());
+        birthCertificateCommand.setCertificateSource(GetRandomOrganisation());
 
     }