|
@@ -14,22 +14,22 @@ import static org.mockito.Mockito.atLeast;
|
|
|
import static org.mockito.Mockito.verify;
|
|
import static org.mockito.Mockito.verify;
|
|
|
|
|
|
|
|
@ExtendWith(MockitoExtension.class)
|
|
@ExtendWith(MockitoExtension.class)
|
|
|
-public class DataLoadCertificateAuthoritiesTest {
|
|
|
|
|
|
|
+public class DataLoadCertificateSourcesTest {
|
|
|
|
|
|
|
|
- private DataLoadCertificateAuthorities dataLoadCertificateAuthorities;
|
|
|
|
|
|
|
+ private DataLoadCertificateSources dataLoadCertificateSources;
|
|
|
|
|
|
|
|
@Mock
|
|
@Mock
|
|
|
private OrganisationService organisationServiceMock;
|
|
private OrganisationService organisationServiceMock;
|
|
|
|
|
|
|
|
@BeforeEach
|
|
@BeforeEach
|
|
|
public void setUp() {
|
|
public void setUp() {
|
|
|
- dataLoadCertificateAuthorities = new DataLoadCertificateAuthorities(organisationServiceMock);
|
|
|
|
|
|
|
+ dataLoadCertificateSources = new DataLoadCertificateSources(organisationServiceMock);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
void certificateSourcesIsLoadedTest() {
|
|
void certificateSourcesIsLoadedTest() {
|
|
|
ArgumentCaptor<OrganisationCommand> captor = ArgumentCaptor.forClass(OrganisationCommand.class);
|
|
ArgumentCaptor<OrganisationCommand> captor = ArgumentCaptor.forClass(OrganisationCommand.class);
|
|
|
- dataLoadCertificateAuthorities.load();
|
|
|
|
|
|
|
+ dataLoadCertificateSources.load();
|
|
|
verify(organisationServiceMock, atLeast(1)).saveOrganisationCommand(captor.capture());
|
|
verify(organisationServiceMock, atLeast(1)).saveOrganisationCommand(captor.capture());
|
|
|
for (OrganisationCommand command : captor.getAllValues()) {
|
|
for (OrganisationCommand command : captor.getAllValues()) {
|
|
|
if (command.getName().equals("General Register Office For Scotland")) {
|
|
if (command.getName().equals("General Register Office For Scotland")) {
|