|
@@ -7,6 +7,7 @@ import org.mockito.ArgumentCaptor;
|
|
|
import org.mockito.Mock;
|
|
import org.mockito.Mock;
|
|
|
import org.mockito.junit.jupiter.MockitoExtension;
|
|
import org.mockito.junit.jupiter.MockitoExtension;
|
|
|
import scot.carricksoftware.grants.domains.places.Country;
|
|
import scot.carricksoftware.grants.domains.places.Country;
|
|
|
|
|
+import scot.carricksoftware.grants.domains.places.Organisation;
|
|
|
import scot.carricksoftware.grants.domains.places.Place;
|
|
import scot.carricksoftware.grants.domains.places.Place;
|
|
|
import scot.carricksoftware.grants.domains.places.Region;
|
|
import scot.carricksoftware.grants.domains.places.Region;
|
|
|
import scot.carricksoftware.grants.services.places.countries.CountryServiceImpl;
|
|
import scot.carricksoftware.grants.services.places.countries.CountryServiceImpl;
|
|
@@ -14,6 +15,7 @@ import scot.carricksoftware.grants.services.places.organisations.OrganisationSer
|
|
|
import scot.carricksoftware.grants.services.places.places.PlaceServiceImpl;
|
|
import scot.carricksoftware.grants.services.places.places.PlaceServiceImpl;
|
|
|
import scot.carricksoftware.grants.services.places.regions.RegionServiceImpl;
|
|
import scot.carricksoftware.grants.services.places.regions.RegionServiceImpl;
|
|
|
|
|
|
|
|
|
|
+import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
import static org.mockito.Mockito.atLeast;
|
|
import static org.mockito.Mockito.atLeast;
|
|
|
import static org.mockito.Mockito.verify;
|
|
import static org.mockito.Mockito.verify;
|
|
@@ -94,5 +96,13 @@ public class DataLoadPlacesTest {
|
|
|
&& place.getRegion().getName().equals("Midlothian")));
|
|
&& place.getRegion().getName().equals("Midlothian")));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
|
+ public void theArmyIsCreatedTest() {
|
|
|
|
|
+ ArgumentCaptor<Organisation> captor = ArgumentCaptor.forClass(Organisation.class);
|
|
|
|
|
+ dataLoadPlaces.load();
|
|
|
|
|
+ verify(organisationServiceMock).save(captor.capture());
|
|
|
|
|
+ assertEquals("The army", captor.getValue().getName());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|