@Test
public void averageTenderPeriod() throws Exception {

    final List<Document> averageTenderPeriod = averageTenderAndAwardPeriodsController
            .averageTenderPeriod(new YearFilterPagingRequest());
    final Document first = averageTenderPeriod.get(0);
    int year = (int) first.get(AverageTenderAndAwardPeriodsController.Keys.YEAR);
    double averageTenderDays = (double) first.get(AverageTenderAndAwardPeriodsController.Keys.AVERAGE_TENDER_DAYS);
    Assert.assertEquals(2014, year);
    Assert.assertEquals(15.0, averageTenderDays, 0);
    final Document second = averageTenderPeriod.get(1);
    year = (int) second.get(AverageTenderAndAwardPeriodsController.Keys.YEAR);
    averageTenderDays = (double) second.get(AverageTenderAndAwardPeriodsController.Keys.AVERAGE_TENDER_DAYS);
    Assert.assertEquals(2015, year);
    Assert.assertEquals(46.0, averageTenderDays, 0);
}