use of de.symeda.sormas.api.infrastructure.country.CountryCriteria in project SORMAS-Project by hzi-braunschweig.
the class CountryFacadeEjbTest method testCount.
@Test
public void testCount() {
creator.createCountry("Romania", "ROU", "642");
creator.createCountry("Germany", "DEU", "276");
CountryCriteria criteria = new CountryCriteria().nameCodeLike("ROU");
long count = getCountryFacade().count(criteria);
assertEquals(1, count);
}
use of de.symeda.sormas.api.infrastructure.country.CountryCriteria in project SORMAS-Project by hzi-braunschweig.
the class CountryImporterTest method testDontImportDuplicateCountry.
@Test
public void testDontImportDuplicateCountry() throws IOException, InvalidColumnException, InterruptedException, CsvValidationException, URISyntaxException {
TestDataCreator.RDCF rdcf = new TestDataCreator().createRDCF("Default Region", "Default District", "Default Community", "Default Facility");
UserDto user = creator.createUser(rdcf.region.getUuid(), rdcf.district.getUuid(), rdcf.facility.getUuid(), "Default", "User", UserRole.ADMIN);
File countryCsvFile = new File(getClass().getClassLoader().getResource("sormas_country_import_test.csv").toURI());
InfrastructureImporter importer = new CountryImporterExtension(countryCsvFile, user);
assertEquals(ImportResultStatus.COMPLETED_WITH_ERRORS, importer.runImport());
assertEquals(1, getCountryFacade().count(new CountryCriteria()));
}
use of de.symeda.sormas.api.infrastructure.country.CountryCriteria in project SORMAS-Project by hzi-braunschweig.
the class CountryFacadeEjbTest method testGetIndexList.
@Test
public void testGetIndexList() {
Country expected = creator.createCountry("Romania", "ROU", "642");
creator.createCountry("Germany", "DEU", "276");
CountryCriteria criteria = new CountryCriteria().nameCodeLike("ROU");
List<CountryIndexDto> actualList = getCountryFacade().getIndexList(criteria, null, null, null);
assertEquals(1, actualList.size());
CountryIndexDto actual = actualList.get(0);
assertEquals(expected.getUuid(), actual.getUuid());
assertEquals(expected.getIsoCode(), actual.getIsoCode());
}
Aggregations