@Test
public void percentTendersUsingEBid() throws Exception {

    final List<Document> percentTendersUsingEBid = tenderPercentagesController
            .percentTendersUsingEBid(new YearFilterPagingRequest());
    final Document first = percentTendersUsingEBid.get(0);
    int year = (int) first.get(TenderPercentagesController.Keys.YEAR);
    int totalTenders = (int) first
            .get(TenderPercentagesController.Keys.TOTAL_TENDERS);
    int totalTendersUsingEbid = (int) first.get(TenderPercentagesController.Keys.TOTAL_TENDERS_USING_EBID);
    double percentageTendersUsingEbid = (double) first
            .get(TenderPercentagesController.Keys.PERCENTAGE_TENDERS_USING_EBID);
    Assert.assertEquals(2014, year);
    Assert.assertEquals(1, totalTenders);
    Assert.assertEquals(1, totalTendersUsingEbid);
    Assert.assertEquals(100.0, percentageTendersUsingEbid, 0);
    final Document second = percentTendersUsingEBid.get(1);
    year = (int) second.get(TenderPercentagesController.Keys.YEAR);
    totalTenders = (int) second
            .get(TenderPercentagesController.Keys.TOTAL_TENDERS);
    totalTendersUsingEbid = (int) second.get(TenderPercentagesController.Keys.TOTAL_TENDERS_USING_EBID);
    percentageTendersUsingEbid = (double) second
            .get(TenderPercentagesController.Keys.PERCENTAGE_TENDERS_USING_EBID);
    Assert.assertEquals(2015, year);
    Assert.assertEquals(1, totalTenders);
    Assert.assertEquals(1, totalTendersUsingEbid);
    Assert.assertEquals(100.0, percentageTendersUsingEbid, 0);
}