@Test
public void test_login_successfully_for_internalcert() {

    String jsonStr = "{  \"username\": \"safeadmin\",  \"password\": \"safeadmin\"}";
    UserLogin userLogin = new UserLogin("safeadmin", "safeadmin");
    String responseJson = "{  \"client_token\": \"8766fdhjSAtH2a4MdvMyzWid\",\"admin\": \"yes\",\"access\": {\"users\":[{\"safe1\":\"read\"}], \"svcacct\":[{\"svc1\":\"read\"}], \"cert\":[{\"cert1\":\"read\"}]},\"policies\": [\"default\",\"safeadmin\"],\"lease_duration\": 1800000, \"feature\": {\"adpwdrotation\": \"true\", \"serviceaccount\":\"true\"}}";
    Response response = getMockResponse(HttpStatus.OK, true, responseJson);
    Map<String, Object> responseMap = null;
    try {
        responseMap = new ObjectMapper().readValue(response.getResponse(), new TypeReference<Map<String, Object>>(){});
    } catch (IOException e) {
        e.printStackTrace();
    }
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseJson);
    when(JSONUtil.getJSON(Mockito.any())).thenReturn(responseJson);
    when(JSONUtil.getJSON(userLogin)).thenReturn(jsonStr);
    when(reqProcessor.process("/auth/userpass/login",jsonStr,"")).thenReturn(response);
    ResponseEntity<String> responseEntity = vaultAuthService.login(userLogin);
    assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}