use of com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary in project cia by Hack23.
the class EsvApiTest method getDataFinanceMinistry1999SuccessTest.
/**
* Gets the data finance ministry 1999 success test.
*
* @return the data finance ministry 1999 success test
*/
@Test
public void getDataFinanceMinistry1999SuccessTest() {
final List<GovernmentBodyAnnualSummary> list = esvApi.getDataPerMinistryAndYear("Finansdepartementet", 1999);
assertNotNull(list);
assertEquals(36, list.size());
for (final GovernmentBodyAnnualSummary governmentBodyAnnualSummary : list) {
assertNotNull(governmentBodyAnnualSummary);
}
}
use of com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary in project cia by Hack23.
the class EsvApiTest method getDataFinanceMinistry2017SuccessTest.
@Test
public void getDataFinanceMinistry2017SuccessTest() {
final List<GovernmentBodyAnnualSummary> list = esvApi.getDataPerMinistryAndYear("Finansdepartementet", 2017);
assertNotNull(list);
assertEquals(44, list.size());
for (final GovernmentBodyAnnualSummary governmentBodyAnnualSummary : list) {
assertNotNull(governmentBodyAnnualSummary);
}
}
use of com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary in project cia by Hack23.
the class EsvApiTest method getDataForeignMinistrySuccessTest.
/**
* Gets the data foreign ministry success test.
*
* @return the data foreign ministry success test
*/
@Test
public void getDataForeignMinistrySuccessTest() {
final Map<Integer, List<GovernmentBodyAnnualSummary>> governmentBodyAnnualSummaryData = esvApi.getDataPerMinistry("Utrikesdepartementet");
assertNotNull(governmentBodyAnnualSummaryData);
assertEquals(20, governmentBodyAnnualSummaryData.size());
for (final List<GovernmentBodyAnnualSummary> list : governmentBodyAnnualSummaryData.values()) {
for (final GovernmentBodyAnnualSummary governmentBodyAnnualSummary : list) {
assertNotNull(governmentBodyAnnualSummary);
}
}
}
use of com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary in project cia by Hack23.
the class EsvApiImpl method getMinistryNames.
@Override
public List<String> getMinistryNames() {
final Set<String> ministryNameSet = new HashSet<>();
final Map<Integer, List<GovernmentBodyAnnualSummary>> data = getData();
for (final List<GovernmentBodyAnnualSummary> list : data.values()) {
for (final GovernmentBodyAnnualSummary governmentBodyAnnualSummary : list) {
if (!ministryNameSet.contains(governmentBodyAnnualSummary.getMinistry()) && governmentBodyAnnualSummary.getHeadCount() > 0 && !NO_MINISTRY.equalsIgnoreCase(governmentBodyAnnualSummary.getMinistry())) {
ministryNameSet.add(governmentBodyAnnualSummary.getMinistry());
}
}
}
return new ArrayList<>(ministryNameSet);
}
Aggregations