@Test public void shouldGetDeliveryZoneByCode() throws Exception { DeliveryZone zone = new DeliveryZone(); when(repository.getByCode("code")).thenReturn(zone); DeliveryZone returnedZone = service.getByCode("code"); verify(repository).getByCode("code"); assertThat(returnedZone, is(zone)); }
public DeliveryZone getByCode(String code) { return repository.getByCode(code); }
DeliveryZoneService { public DeliveryZone getByCode(String code) { return repository.getByCode(code); } }
DeliveryZoneService { public DeliveryZone getByCode(String code) { return repository.getByCode(code); }  }
DeliveryZoneService { public DeliveryZone getByCode(String code) { return repository.getByCode(code); }  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 DeliveryZone getByCode(String code) { return repository.getByCode(code); }  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);  }