@Test void addLocation(@Mock DistanceMatrixRow matrixRow) { when(distanceMatrix.addLocation(any())).thenReturn(matrixRow); assertThat(locationService.addLocation(location)).isTrue(); verifyNoInteractions(repository); verify(distanceMatrix).addLocation(location); verify(optimizer).addLocation(location, matrixRow); }
public synchronized boolean addLocation(Location location) { return submitToPlanner(Objects.requireNonNull(location)); }
LocationService { public synchronized boolean addLocation(Location location) { return submitToPlanner(Objects.requireNonNull(location)); } }
LocationService { public synchronized boolean addLocation(Location location) { return submitToPlanner(Objects.requireNonNull(location)); } @Autowired  LocationService(
            LocationRepository repository,
            RouteOptimizer optimizer,
            DistanceMatrix distanceMatrix,
            ApplicationEventPublisher eventPublisher); }
LocationService { public synchronized boolean addLocation(Location location) { return submitToPlanner(Objects.requireNonNull(location)); } @Autowired  LocationService(
            LocationRepository repository,
            RouteOptimizer optimizer,
            DistanceMatrix distanceMatrix,
            ApplicationEventPublisher eventPublisher); synchronized boolean createLocation(Coordinates coordinates, String description); synchronized boolean addLocation(Location location); synchronized void removeLocation(long id); synchronized void removeAll(); }
LocationService { public synchronized boolean addLocation(Location location) { return submitToPlanner(Objects.requireNonNull(location)); } @Autowired  LocationService(
            LocationRepository repository,
            RouteOptimizer optimizer,
            DistanceMatrix distanceMatrix,
            ApplicationEventPublisher eventPublisher); synchronized boolean createLocation(Coordinates coordinates, String description); synchronized boolean addLocation(Location location); synchronized void removeLocation(long id); synchronized void removeAll();  }