@Test public void shouldGetAllDeliveryZones() throws Exception { List<DeliveryZone> deliveryZones = new ArrayList<>(); when(repository.getAll()).thenReturn(deliveryZones); List<DeliveryZone> returnedZones = service.getAll(); verify(repository).getAll(); assertThat(returnedZones, is(deliveryZones)); }
public List<DeliveryZone> getAll() { return repository.getAll(); }
DeliveryZoneService { public List<DeliveryZone> getAll() { return repository.getAll(); } }
DeliveryZoneService { public List<DeliveryZone> getAll() { return repository.getAll(); }  }
DeliveryZoneService { public List<DeliveryZone> getAll() { return repository.getAll(); }  void save(DeliveryZone zone); DeliveryZone getByCode(String code); List<DeliveryZone> getByUserForRight(long userId, String rightName); List<Program> getActiveProgramsForDeliveryZone(long zoneId); DeliveryZone getById(Long id); List<DeliveryZone> getAll(); List<Program> getAllProgramsForDeliveryZone(Long zoneId); }
DeliveryZoneService { public List<DeliveryZone> getAll() { return repository.getAll(); }  void save(DeliveryZone zone); DeliveryZone getByCode(String code); List<DeliveryZone> getByUserForRight(long userId, String rightName); List<Program> getActiveProgramsForDeliveryZone(long zoneId); DeliveryZone getById(Long id); List<DeliveryZone> getAll(); List<Program> getAllProgramsForDeliveryZone(Long zoneId);  }