use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class CountPlansTendersAwardsControllerTest method countAwardsByYear.
@Test
public void countAwardsByYear() throws Exception {
final List<DBObject> countAwardsByYear = countPlansTendersAwardsController.countAwardsByYear(new YearFilterPagingRequest());
final DBObject first = countAwardsByYear.get(0);
int year = (int) first.get(CountPlansTendersAwardsController.Keys.YEAR);
int count = (int) first.get(CountPlansTendersAwardsController.Keys.COUNT);
Assert.assertEquals(2015, year);
Assert.assertEquals(1, count);
final DBObject second = countAwardsByYear.get(1);
year = (int) second.get(CountPlansTendersAwardsController.Keys.YEAR);
count = (int) second.get(CountPlansTendersAwardsController.Keys.COUNT);
Assert.assertEquals(2016, year);
Assert.assertEquals(2, count);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class FrequentTenderersControllerTest method frequentTenderersTest.
@Test
public void frequentTenderersTest() throws Exception {
final List<DBObject> frequentTenderers = frequentTenderersController.frequentTenderers(new YearFilterPagingRequest());
Assert.assertEquals(0, frequentTenderers.size());
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class FrequentTenderersControllerTest method activeAwardsCountTest.
@Test
public void activeAwardsCountTest() throws Exception {
final List<DBObject> frequentTenderers = frequentTenderersController.activeAwardsCount(new YearFilterPagingRequest());
Assert.assertEquals(2, frequentTenderers.size());
Assert.assertEquals(1, frequentTenderers.get(0).get("cnt"));
Assert.assertEquals(1, frequentTenderers.get(1).get("cnt"));
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer 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 oc-explorer by devgateway.
the class LocationInfowindowControllerTest method tendersByLocation.
@Test
public void tendersByLocation() throws Exception {
final List<DBObject> tendersByLocation = locationInfowindowController.tendersByLocation(new YearFilterPagingRequest());
Assert.assertEquals(1, tendersByLocation.size());
final DBObject first = tendersByLocation.get(0);
}
Aggregations