@Test
void should_not_call_router_when_repo_is_full() {

    Location l1 = location(1, 0);
    Location l2 = location(2, 0);
    when(distanceRepository.getDistance(l1, l2)).thenReturn(0L);
    when(distanceRepository.getDistance(l2, l1)).thenReturn(1L);
    // no calculation for the first location
    distanceMatrix.addLocation(l1);
    verifyNoInteractions(distanceCalculator);
    verifyNoInteractions(distanceRepository);
    distanceMatrix.addLocation(l2);
    // get distances from the repository
    verify(distanceRepository).getDistance(l2, l1);
    verify(distanceRepository).getDistance(l1, l2);
    // nothing to persist
    verify(distanceRepository, never()).saveDistance(any(Location.class), any(Location.class), anyLong());
    // no calculation
    verifyNoInteractions(distanceCalculator);
}