@Test
public void test_authenticateLdap_failure_400() {

    UserLogin userLogin = new UserLogin("safeadmin", "safeadmin");
    Response response = getMockResponse(HttpStatus.BAD_REQUEST, true, "{\"errors\": [\"User Authentication failed\", \"Invalid username or password. Please retry again after correcting username or password.\"]}");
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.BAD_REQUEST).body("{\"errors\": [\"User Authentication failed\", \"Invalid username or password. Please retry again after correcting username or password.\"]}");
    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.BAD_REQUEST, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}