use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn 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 ocvn by devgateway.
the class OcdsControllerTest method ocdsPackages.
@Test
public void ocdsPackages() throws Exception {
final List<ReleasePackage> releasePackages = ocdsController.ocdsPackages(new YearFilterPagingRequest());
Assert.assertEquals(3, releasePackages.size());
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class TenderPriceByTypeYearControllerTest method tenderPriceByAllBidSelectionMethods.
@Test
public void tenderPriceByAllBidSelectionMethods() throws Exception {
final List<DBObject> tenderPriceByAllBidSelectionMethods = tenderPriceByTypeYearController.tenderPriceByAllBidSelectionMethods(new YearFilterPagingRequest());
final DBObject first = tenderPriceByAllBidSelectionMethods.get(1);
Number totalTenderAmount = (Number) first.get(TenderPriceByTypeYearController.Keys.TOTAL_TENDER_AMOUNT);
String procurementMethodDetails = (String) first.get(TenderPriceByTypeYearController.Keys.PROCUREMENT_METHOD_DETAILS);
Assert.assertEquals("Competitive offers", procurementMethodDetails);
Assert.assertEquals(9000.0, totalTenderAmount.doubleValue(), 0);
final DBObject second = tenderPriceByAllBidSelectionMethods.get(0);
totalTenderAmount = (Number) second.get(TenderPriceByTypeYearController.Keys.TOTAL_TENDER_AMOUNT);
procurementMethodDetails = (String) second.get(TenderPriceByTypeYearController.Keys.PROCUREMENT_METHOD_DETAILS);
Assert.assertEquals("Chưa xác định", procurementMethodDetails);
Assert.assertEquals(600000.0, totalTenderAmount.doubleValue(), 0);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class TopTenControllerTest method topTenLargestTenders.
@Test
public void topTenLargestTenders() throws Exception {
final List<DBObject> topTenLargestTenders = topTenController.topTenLargestTenders(new YearFilterPagingRequest());
Assert.assertEquals(3, topTenLargestTenders.size());
final DBObject first = topTenLargestTenders.get(0);
BasicDBObject tender = (BasicDBObject) first.get("tender");
BasicDBObject value = (BasicDBObject) tender.get("value");
double amount = (double) value.get("amount");
Assert.assertEquals(600000.0, amount, 0);
final DBObject second = topTenLargestTenders.get(1);
tender = (BasicDBObject) second.get("tender");
value = (BasicDBObject) tender.get("value");
amount = (double) value.get("amount");
Assert.assertEquals(400000.0, amount, 0);
final DBObject third = topTenLargestTenders.get(2);
tender = (BasicDBObject) third.get("tender");
value = (BasicDBObject) tender.get("value");
amount = (double) value.get("amount");
Assert.assertEquals(9000.0, amount, 0);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class CorruptionRiskDashboardIndicatorsStatsControllerTest method totalFlaggedIndicatorsByIndicatorTypeByYearTest.
@Test
public void totalFlaggedIndicatorsByIndicatorTypeByYearTest() throws Exception {
final List<DBObject> result = corruptionRiskDashboardIndicatorsStatsController.totalFlaggedIndicatorsByIndicatorTypeByYear(new YearFilterPagingRequest());
Assert.assertEquals(1, result.size());
Assert.assertEquals(FlagType.RIGGING.toString(), result.get(0).get(CorruptionRiskDashboardIndicatorsStatsController.Keys.TYPE));
Assert.assertEquals(2, result.get(0).get(CorruptionRiskDashboardIndicatorsStatsController.Keys.INDICATOR_COUNT));
Assert.assertEquals(2015, result.get(0).get(CorruptionRiskDashboardIndicatorsStatsController.Keys.YEAR));
}
Aggregations