@Test public void shouldGetDeliveryZoneById() throws Exception { DeliveryZone zone = new DeliveryZone(); when(repository.getById(1l)).thenReturn(zone); DeliveryZone returnedZone = service.getById(1l); verify(repository).getById(1l); assertThat(returnedZone, is(zone)); }
public DeliveryZone getById(Long id) { return repository.getById(id); }
DeliveryZoneService { public DeliveryZone getById(Long id) { return repository.getById(id); } }
DeliveryZoneService { public DeliveryZone getById(Long id) { return repository.getById(id); }  }
DeliveryZoneService { public DeliveryZone getById(Long id) { return repository.getById(id); }  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 getById(Long id) { return repository.getById(id); }  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);  }