@Test public void authenticate_2012000000089_xyz123() { LoginToken loginToken = authenticationService.authenticate("2012000000089", "xyz123"); assertEquals("2012000000089", loginToken.getUsername()); assertEquals("Md. Masum", loginToken.getFullname()); assertEquals("student", loginToken.getRole()); }
public LoginToken authenticate(String username, String password) { RestTemplate restTemplate = new RestTemplate(); MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>(); multiValueMap.add("username", username); multiValueMap.add("password", password); LoginToken loginToken = restTemplate.postForObject(authUrl, multiValueMap, LoginToken.class); return loginToken; }
AuthenticationService { public LoginToken authenticate(String username, String password) { RestTemplate restTemplate = new RestTemplate(); MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>(); multiValueMap.add("username", username); multiValueMap.add("password", password); LoginToken loginToken = restTemplate.postForObject(authUrl, multiValueMap, LoginToken.class); return loginToken; } }
AuthenticationService { public LoginToken authenticate(String username, String password) { RestTemplate restTemplate = new RestTemplate(); MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>(); multiValueMap.add("username", username); multiValueMap.add("password", password); LoginToken loginToken = restTemplate.postForObject(authUrl, multiValueMap, LoginToken.class); return loginToken; }  }
AuthenticationService { public LoginToken authenticate(String username, String password) { RestTemplate restTemplate = new RestTemplate(); MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>(); multiValueMap.add("username", username); multiValueMap.add("password", password); LoginToken loginToken = restTemplate.postForObject(authUrl, multiValueMap, LoginToken.class); return loginToken; }  LoginToken authenticate(String username, String password); }
AuthenticationService { public LoginToken authenticate(String username, String password) { RestTemplate restTemplate = new RestTemplate(); MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>(); multiValueMap.add("username", username); multiValueMap.add("password", password); LoginToken loginToken = restTemplate.postForObject(authUrl, multiValueMap, LoginToken.class); return loginToken; }  LoginToken authenticate(String username, String password);  }