@Test
public void test_login_successfully() {

    UserLogin user = new UserLogin("testuser", "testuser");
    String jsonStr = "{\"username\":\"testuser\",\"password\":\"testuser\"}";
    String responseJson = "{\"client_token\":\"1sGWOpjPOuZezcIgxVFAm1Oh\",\"admin\":\"no\",\"access\":{},\"policies\":[\"default\"],\"lease_duration\":1800000}";
    Response response = getMockResponse(HttpStatus.OK, true, responseJson);
    response.setAdminPolicies(null);
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(response.toString());
    when(JSONUtil.getJSON(user)).thenReturn(jsonStr);
    when(reqProcessor.process("/auth/userpass/login",jsonStr,"")).thenReturn(response);
    ResponseEntity<String> responseEntity = userPassService.login(user);
    assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}