@Test
public void countAwardsByYear() throws Exception {

    final List<Document> countAwardsByYear = countPlansTendersAwardsController
            .countAwardsByYear(new YearFilterPagingRequest());
    final Document 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 Document 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);
}