@Test public void test_should_return_otp_for_given_search_criteria() { final Token expectedToken = Token.builder().build(); final TokenSearchCriteria searchCriteria = new TokenSearchCriteria("uuid", "tenant"); when(tokenRepository.findBy(searchCriteria)).thenReturn(expectedToken); final Token actualToken = tokenService.search(searchCriteria); assertEquals(expectedToken, actualToken); }
public Token search(TokenSearchCriteria searchCriteria) { return tokenRepository.findBy(searchCriteria); }
TokenService { public Token search(TokenSearchCriteria searchCriteria) { return tokenRepository.findBy(searchCriteria); } }
TokenService { public Token search(TokenSearchCriteria searchCriteria) { return tokenRepository.findBy(searchCriteria); } @Autowired  TokenService(TokenRepository tokenRepository); }
TokenService { public Token search(TokenSearchCriteria searchCriteria) { return tokenRepository.findBy(searchCriteria); } @Autowired  TokenService(TokenRepository tokenRepository); Token create(TokenRequest tokenRequest); Token validate(ValidateRequest validateRequest); Token search(TokenSearchCriteria searchCriteria); }
TokenService { public Token search(TokenSearchCriteria searchCriteria) { return tokenRepository.findBy(searchCriteria); } @Autowired  TokenService(TokenRepository tokenRepository); Token create(TokenRequest tokenRequest); Token validate(ValidateRequest validateRequest); Token search(TokenSearchCriteria searchCriteria);  }