@Test public void shouldGetById() throws Exception{ ServiceType serviceType = new ServiceType(); serviceType.setName("the service type"); when(mapper.getById(1L)).thenReturn(serviceType); ServiceType returnedValue = repository.getById(1L); assertThat(returnedValue, is(serviceType)); }
public ServiceType getById(Long id){ return mapper.getById(id); }
ServiceTypeRepository { public ServiceType getById(Long id){ return mapper.getById(id); } }
ServiceTypeRepository { public ServiceType getById(Long id){ return mapper.getById(id); }  }
ServiceTypeRepository { public ServiceType getById(Long id){ return mapper.getById(id); }  ServiceType getById(Long id); List<ServiceType> getAll(); void insert(ServiceType serviceType); void update(ServiceType serviceType); }
ServiceTypeRepository { public ServiceType getById(Long id){ return mapper.getById(id); }  ServiceType getById(Long id); List<ServiceType> getAll(); void insert(ServiceType serviceType); void update(ServiceType serviceType);  }