|
@@ -12,8 +12,9 @@ import org.mockito.Mock;
|
|
import org.mockito.junit.jupiter.MockitoExtension;
|
|
import org.mockito.junit.jupiter.MockitoExtension;
|
|
import scot.carricksoftware.grantswriter.domains.people.Person;
|
|
import scot.carricksoftware.grantswriter.domains.people.Person;
|
|
import scot.carricksoftware.grantswriter.services.people.PersonService;
|
|
import scot.carricksoftware.grantswriter.services.people.PersonService;
|
|
-import scot.carricksoftware.grantswriter.writer.latex.parts.people.PeoplePart;
|
|
|
|
-import scot.carricksoftware.grantswriter.writer.latex.parts.people.PeoplePartImpl;
|
|
|
|
|
|
+import scot.carricksoftware.grantswriter.writer.latex.parts.people.PeoplePartHeader;
|
|
|
|
+import scot.carricksoftware.grantswriter.writer.latex.parts.people.PeoplePartWriter;
|
|
|
|
+import scot.carricksoftware.grantswriter.writer.latex.parts.people.PeoplePartWriterImpl;
|
|
import scot.carricksoftware.grantswriter.writer.latex.sections.PersonSection;
|
|
import scot.carricksoftware.grantswriter.writer.latex.sections.PersonSection;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -26,9 +27,9 @@ import static org.mockito.Mockito.when;
|
|
import static scot.carricksoftware.grantswriter.GenerateRandomPeopleValues.GetRandomPerson;
|
|
import static scot.carricksoftware.grantswriter.GenerateRandomPeopleValues.GetRandomPerson;
|
|
|
|
|
|
@ExtendWith(MockitoExtension.class)
|
|
@ExtendWith(MockitoExtension.class)
|
|
-class PeoplePartTest {
|
|
|
|
|
|
+class PeoplePartWriterTest {
|
|
|
|
|
|
- private PeoplePart peoplePart;
|
|
|
|
|
|
+ private PeoplePartWriter peoplePartWriter;
|
|
|
|
|
|
@Mock
|
|
@Mock
|
|
private PersonService personServiceMock;
|
|
private PersonService personServiceMock;
|
|
@@ -36,10 +37,13 @@ class PeoplePartTest {
|
|
@Mock
|
|
@Mock
|
|
private PersonSection personSectionMock;
|
|
private PersonSection personSectionMock;
|
|
|
|
|
|
|
|
+ @Mock
|
|
|
|
+ private PeoplePartHeader peopleHeaderMock;
|
|
|
|
+
|
|
@SuppressWarnings("EmptyMethod")
|
|
@SuppressWarnings("EmptyMethod")
|
|
@BeforeEach
|
|
@BeforeEach
|
|
void setUp() {
|
|
void setUp() {
|
|
- peoplePart = new PeoplePartImpl(personServiceMock, personSectionMock);
|
|
|
|
|
|
+ peoplePartWriter = new PeoplePartWriterImpl(personServiceMock, peopleHeaderMock, personSectionMock);
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
@@ -53,7 +57,7 @@ class PeoplePartTest {
|
|
|
|
|
|
when(personServiceMock.findAll()).thenReturn(people);
|
|
when(personServiceMock.findAll()).thenReturn(people);
|
|
|
|
|
|
- peoplePart.write();
|
|
|
|
|
|
+ peoplePartWriter.write();
|
|
verify(personSectionMock, times(limit)).write(any());
|
|
verify(personSectionMock, times(limit)).write(any());
|
|
}
|
|
}
|
|
}
|
|
}
|