@Test
public void averageAwardPeriod() throws Exception {

    final List<Document> averageAwardPeriod = averageTenderAndAwardPeriodsController
            .averageAwardPeriod(new YearFilterPagingRequest());
    final Document first = averageAwardPeriod.get(0);
    int year = (int) first.get(AverageTenderAndAwardPeriodsController.Keys.YEAR);
    double averageAwardDays = (double) first.get(AverageTenderAndAwardPeriodsController.Keys.AVERAGE_AWARD_DAYS);
    Assert.assertEquals(2015, year);
    Assert.assertEquals(365.0, averageAwardDays, 0);
    final Document second = averageAwardPeriod.get(1);
    year = (int) second.get(AverageTenderAndAwardPeriodsController.Keys.YEAR);
    averageAwardDays = (double) second.get(AverageTenderAndAwardPeriodsController.Keys.AVERAGE_AWARD_DAYS);
    Assert.assertEquals(2016, year);
    Assert.assertEquals(405.0, averageAwardDays, 0);
}