@Test
public void test_authenticateLdap_failure_500() {

    UserLogin userLogin = new UserLogin("safeadmin", "safeadmin");
    Response response = getMockResponse(HttpStatus.INTERNAL_SERVER_ERROR, true, "{\"errors\": [\"User Authentication failed\", \"This may be due to vault services are down or vault services are not reachable\"]}");
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("{\"errors\": [\"User Authentication failed\", \"This may be due to vault services are down or vault services are not reachable\"]}");
    String jsonStr = "{  \"username\": \"safeadmin\", \"password\": \"safeadmin\"}";
    when(JSONUtil.getJSON(userLogin)).thenReturn(jsonStr);
    when(reqProcessor.process("/auth/ldap/login",jsonStr,"")).thenReturn(response);
    ResponseEntity<String> responseEntity = ldapAuthService.authenticateLdap(userLogin);
    assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}