assertEquals(unSkippedBuild, Iterables.getOnlyElement(historyWidget.getBaseList()));
}
@Test
public void should_return_oldest_running_build() {
DynamicBuild finishedBuild = newBuild().get();
DynamicBuild finishedBuild2 = newBuild().get();
DynamicBuild runningBuild = newBuild().building().get();
DynamicBuild runningBuild2 = newBuild().building().get();
List<? extends DbBackedBuild> builds = list(finishedBuild, runningBuild, finishedBuild2, runningBuild2);
String buildId = String.valueOf(runningBuild2.getNumber());
when(buildRepo.getLast(project, BranchHistoryWidget.BUILD_COUNT, null)).thenReturn((Iterable<DbBackedBuild>) builds);
assertEquals(buildId, historyWidget.getNextBuildToFetch((Iterable<DbBackedBuild>) builds, adapter).getBuildNumber(adapter));
}