@Test
public void test_configureLdapGroup_failed_500() {

    String token = "4EpPYDSfgN2D4Gf7UmNO3nuL";
    String jsonStr = "{\"groupname\":\"admin\",\"policies\": \"admin,default\"}";
    Response responseGroup = getMockResponse(HttpStatus.OK, true, "{\"data\": { \"policies\": [ \"admin\", \"default\"] }}");
    Response responseFailure = getMockResponse(HttpStatus.INTERNAL_SERVER_ERROR, false, "{\"errors\":[\"LDAP Group configuration failed\"]}");
    Response responseOk = getMockResponse(HttpStatus.OK, true, "");
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("{\"messages\":[\"LDAP Group configured\"]}");
    LDAPGroup ldapGroup = new LDAPGroup("admin", "admin,default");
    when(JSONUtil.getJSON(ldapGroup)).thenReturn(jsonStr);
    when(ControllerUtil.updateMetaDataOnConfigChanges(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(responseOk);
    when(reqProcessor.process("/auth/ldap/groups","{\"groupname\":\"admin\"}",token)).thenReturn(responseGroup);
    when(reqProcessor.process("/auth/ldap/groups/configure",jsonStr,token)).thenReturn(responseFailure);
    ResponseEntity<String> responseEntity = ldapAuthService.configureLdapGroup(token, ldapGroup);
    assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
    //assertEquals(responseEntityExpected, responseEntity);
}