@Test public void shouldGetCrn() { ServiceRequestRegistrationNumber expected = new ServiceRequestRegistrationNumber("crn"); SevaNumberGeneratorService sevaNumberGeneratorService = new SevaNumberGeneratorService(crnRepository); when(crnRepository.getCrn("default")).thenReturn(expected); String crn = sevaNumberGeneratorService.generate("default"); assertEquals(expected.getValue(), crn); verify(crnRepository).getCrn("default"); }
public String generate(String tenantId) { return crnRepository.getCrn(tenantId).getValue(); }
SevaNumberGeneratorService { public String generate(String tenantId) { return crnRepository.getCrn(tenantId).getValue(); } }
SevaNumberGeneratorService { public String generate(String tenantId) { return crnRepository.getCrn(tenantId).getValue(); } @Autowired  SevaNumberGeneratorService(CrnRepository crnRepository); }
SevaNumberGeneratorService { public String generate(String tenantId) { return crnRepository.getCrn(tenantId).getValue(); } @Autowired  SevaNumberGeneratorService(CrnRepository crnRepository); String generate(String tenantId); }
SevaNumberGeneratorService { public String generate(String tenantId) { return crnRepository.getCrn(tenantId).getValue(); } @Autowired  SevaNumberGeneratorService(CrnRepository crnRepository); String generate(String tenantId);  }