|
@@ -47,13 +47,15 @@ class GatherDeathCertificateDeceasedTimeLineDataWhenNotRegisteredTest {
|
|
|
|
|
|
private Person informant;
|
|
private Person informant;
|
|
|
|
|
|
|
|
+ DeathCertificate deathCertificate;
|
|
|
|
+
|
|
|
|
|
|
@BeforeEach
|
|
@BeforeEach
|
|
void setUp() {
|
|
void setUp() {
|
|
gatherDeathCertificateDeceasedTimeLineData = new GatherDeathCertificateDeceasedTimeLineDataImpl(this.timelineDataMock);
|
|
gatherDeathCertificateDeceasedTimeLineData = new GatherDeathCertificateDeceasedTimeLineDataImpl(this.timelineDataMock);
|
|
deathCertificates = new ArrayList<>();
|
|
deathCertificates = new ArrayList<>();
|
|
|
|
|
|
- DeathCertificate deathCertificate = new DeathCertificate();
|
|
|
|
|
|
+ deathCertificate = new DeathCertificate();
|
|
timeLine = new TreeMap<>();
|
|
timeLine = new TreeMap<>();
|
|
place = GetRandomPlace();
|
|
place = GetRandomPlace();
|
|
registrationAuthority = new Organisation();
|
|
registrationAuthority = new Organisation();
|
|
@@ -61,7 +63,6 @@ class GatherDeathCertificateDeceasedTimeLineDataWhenNotRegisteredTest {
|
|
deceased = GetRandomPerson();
|
|
deceased = GetRandomPerson();
|
|
informant = GetRandomPerson();
|
|
informant = GetRandomPerson();
|
|
setUpCertificate(deathCertificate);
|
|
setUpCertificate(deathCertificate);
|
|
- deathCertificates.add(deathCertificate);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -75,7 +76,19 @@ class GatherDeathCertificateDeceasedTimeLineDataWhenNotRegisteredTest {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
- void registeredByTest() {
|
|
|
|
|
|
+ void registeredByNullTest() {
|
|
|
|
+ deathCertificate.setWhenRegistered(null);
|
|
|
|
+ deathCertificates.add(deathCertificate);
|
|
|
|
+ when(timelineDataMock.getTimeLine()).thenReturn(timeLine);
|
|
|
|
+ gatherDeathCertificateDeceasedTimeLineData.gather(deathCertificates);
|
|
|
|
+ String expected = "Death registered by " + informant + " at " + registrationAuthority;
|
|
|
|
+ assertTrue(timelineContains(expected));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ void registeredByEmptyTest() {
|
|
|
|
+ deathCertificate.setWhenRegistered("");
|
|
|
|
+ deathCertificates.add(deathCertificate);
|
|
when(timelineDataMock.getTimeLine()).thenReturn(timeLine);
|
|
when(timelineDataMock.getTimeLine()).thenReturn(timeLine);
|
|
gatherDeathCertificateDeceasedTimeLineData.gather(deathCertificates);
|
|
gatherDeathCertificateDeceasedTimeLineData.gather(deathCertificates);
|
|
String expected = "Death registered by " + informant + " at " + registrationAuthority;
|
|
String expected = "Death registered by " + informant + " at " + registrationAuthority;
|