@SuppressWarnings("unchecked")
@Test
void shouldGetData() {

    final List<HistoryTrendItem> history = randomHistoryTrendItems();
    final List<HistoryTrendItem> data = HistoryTrendPlugin.getData(createSingleLaunchResults(
            singletonMap(HISTORY_TREND_BLOCK_NAME, history),
            randomTestResult().setStatus(Status.PASSED),
            randomTestResult().setStatus(Status.FAILED),
            randomTestResult().setStatus(Status.FAILED)
    ));
    assertThat(data)
            .hasSize(1 + history.size())
            .extracting(HistoryTrendItem::getStatistic)
            .extracting(Statistic::getTotal, Statistic::getFailed, Statistic::getPassed)
            .first()
            .isEqualTo(Tuple.tuple(3L, 2L, 1L));
    final List<HistoryTrendItem> next = data.subList(1, data.size());
    assertThat(next)
            .containsExactlyElementsOf(history);
}