use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class CorruptionRiskDashboardTablesControllerTest method corruptionRiskOverviewTableTest.
@Test
public void corruptionRiskOverviewTableTest() throws Exception {
final List<DBObject> result = corruptionRiskDashboardTablesController.corruptionRiskOverviewTable(new YearFilterPagingRequest());
Assert.assertEquals(1, result.size());
Assert.assertEquals("[ocds-endpoint-001] procuringEntity name", ((DBObject) result.get(0).get("procuringEntity")).get("name"));
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class FundingByLocationControllerTest method fundingByTenderDeliveryLocation.
@Test
public void fundingByTenderDeliveryLocation() throws Exception {
final List<DBObject> fundingByTenderDeliveryLocation = fundingByLocationController.fundingByTenderDeliveryLocation(new YearFilterPagingRequest());
final DBObject first = fundingByTenderDeliveryLocation.get(0);
int year = (int) first.get(FundingByLocationController.Keys.YEAR);
BasicDBObject deliveryLocation = (BasicDBObject) first.get(FundingByLocationController.Keys.ITEMS_DELIVERY_LOCATION);
BasicDBObject geometry = (BasicDBObject) deliveryLocation.get("geometry");
String geometryType = (String) geometry.get("type");
List<Double> coordinates = (List<Double>) geometry.get("coordinates");
double totalTendersAmount = (double) first.get(FundingByLocationController.Keys.TOTAL_TENDERS_AMOUNT);
int tendersCount = (int) first.get(FundingByLocationController.Keys.TENDERS_COUNT);
Assert.assertEquals(2015, year);
Assert.assertEquals("Point", geometryType);
Assert.assertEquals(new ArrayList<>(Arrays.asList(45.9432, 24.9668)), coordinates);
Assert.assertEquals(9000.0, totalTendersAmount, 0);
Assert.assertEquals(1, tendersCount);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class FundingByLocationControllerTest method qualityFundingByTenderDeliveryLocation.
@Test
public void qualityFundingByTenderDeliveryLocation() throws Exception {
final List<DBObject> qualityFundingByTenderDeliveryLocation = fundingByLocationController.qualityFundingByTenderDeliveryLocation(new YearFilterPagingRequest());
final DBObject first = qualityFundingByTenderDeliveryLocation.get(0);
int totalTendersWithStartDate = (int) first.get(FundingByLocationController.Keys.TOTAL_TENDERS_WITH_START_DATE);
int totalTendersWithStartDateAndLocation = (int) first.get(FundingByLocationController.Keys.TOTAL_TENDERS_WITH_START_DATE_AND_LOCATION);
double percentTendersWithStartDateAndLocation = (double) first.get(FundingByLocationController.Keys.PERCENT_TENDERS_WITH_START_DATE_AND_LOCATION);
Assert.assertEquals(3, totalTendersWithStartDate);
Assert.assertEquals(1, totalTendersWithStartDateAndLocation);
Assert.assertEquals(33.33, percentTendersWithStartDateAndLocation, 1E-2);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class LocationInfowindowControllerTest method awardsByLocation.
@Test
public void awardsByLocation() throws Exception {
final List<DBObject> awardsByLocation = locationInfowindowController.awardsByLocation(new YearFilterPagingRequest());
Assert.assertEquals(1, awardsByLocation.size());
final DBObject first = awardsByLocation.get(0);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class LocationInfowindowControllerTest method planningByLocation.
@Test
public void planningByLocation() throws Exception {
final List<DBObject> planningByLocation = locationInfowindowController.planningByLocation(new YearFilterPagingRequest());
Assert.assertEquals(1, planningByLocation.size());
final DBObject first = planningByLocation.get(0);
}
Aggregations