@Test
public void test_configureLdapUser_successfully_metaUpdate_failure() {

    String token = "4EpPYDSfgN2D4Gf7UmNO3nuL";
    String jsonStr = "{ \"policies\": \"admin,default\",\"username\": \"safeadmin\"}";
    Response responseNotFound = getMockResponse(HttpStatus.NOT_FOUND, false, "");
    Response responseNoContent = getMockResponse(HttpStatus.NO_CONTENT, true, "");
    Response responseOk = getMockResponse(HttpStatus.MULTI_STATUS, false, "Meta data update failed");
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.MULTI_STATUS).body("{\"messages\":[\"LDAP user configured\",\"Meta data update failed\"]}");
    LDAPUser ldapUser = new LDAPUser("safeadmin", "admin,default");
    when(JSONUtil.getJSON(ldapUser)).thenReturn(jsonStr);
    when(ControllerUtil.updateMetaDataOnConfigChanges(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(responseOk);
    when(reqProcessor.process("/auth/ldap/users","{\"username\":\"safeadmin\"}",token)).thenReturn(responseNotFound);
    when(reqProcessor.process("/auth/ldap/users/configure",jsonStr,token)).thenReturn(responseNoContent);
    ResponseEntity<String> responseEntity = ldapAuthService.configureLdapUser(token, ldapUser);
    assertEquals(HttpStatus.MULTI_STATUS, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}