@Test
public void percentTendersWithLinkedProcurementPlan() throws Exception {

    final List<Document> percentTendersWithLinkedProcurementPlan = tenderPercentagesController
            .percentTendersWithLinkedProcurementPlan(new YearFilterPagingRequest());
    final Document first = percentTendersWithLinkedProcurementPlan.get(0);
    int year = (int) first.get(TenderPercentagesController.Keys.YEAR);
    int totalTendersWithLinkedProcurementPlan = (int) first
            .get(TenderPercentagesController.Keys.TOTAL_TENDERS_WITH_LINKED_PROCUREMENT_PLAN);
    int totalTenders = (int) first
            .get(TenderPercentagesController.Keys.TOTAL_TENDERS);
    double percentTenders = (double) first.get(TenderPercentagesController.Keys.PERCENT_TENDERS);
    Assert.assertEquals(2014, year);
    Assert.assertEquals(1, totalTendersWithLinkedProcurementPlan);
    Assert.assertEquals(1, totalTenders);
    Assert.assertEquals(100.0, percentTenders, 0);
    final Document second = percentTendersWithLinkedProcurementPlan.get(1);
    year = (int) second.get(TenderPercentagesController.Keys.YEAR);
    totalTendersWithLinkedProcurementPlan = (int) second
            .get(TenderPercentagesController.Keys.TOTAL_TENDERS_WITH_LINKED_PROCUREMENT_PLAN);
    totalTenders = (int) second
            .get(TenderPercentagesController.Keys.TOTAL_TENDERS);
    percentTenders = (double) second.get(TenderPercentagesController.Keys.PERCENT_TENDERS);
    Assert.assertEquals(2015, year);
    Assert.assertEquals(2, totalTendersWithLinkedProcurementPlan);
    Assert.assertEquals(2, totalTenders);
    Assert.assertEquals(100.0, percentTenders, 0);
}