Search in sources :

Example 1 with Pair

use of org.alfresco.rest.api.tests.client.Pair in project alfresco-remote-api by Alfresco.

the class TestPeople method testUpdatePersonWithNotUpdatableFields.

@Test
public void testUpdatePersonWithNotUpdatableFields() throws PublicApiException {
    final String personId = account3.createUser().getId();
    publicApiClient.setRequestContext(new RequestContext(account3.getId(), account3Admin, "admin"));
    List<Pair<String, String>> notUpdatableFields = new ArrayList<>();
    notUpdatableFields.add(new Pair("userName", "userName"));
    notUpdatableFields.add(new Pair("avatarId", "avatarId"));
    notUpdatableFields.add(new Pair("statusUpdatedAt", "statusUpdatedAt"));
    notUpdatableFields.add(new Pair("quota", "quota"));
    notUpdatableFields.add(new Pair("quotaUsed", "quotaUsed"));
    for (Pair<String, String> notUpdatableField : notUpdatableFields) {
        people.update("people", personId, null, null, "{\n" + "\"" + notUpdatableField.getFirst() + "\": \"" + notUpdatableField.getSecond() + "\"\n" + "}", null, "Expected 400 response when updating " + personId, 400);
    }
}
Also used : ArrayList(java.util.ArrayList) RequestContext(org.alfresco.rest.api.tests.client.RequestContext) Pair(org.alfresco.rest.api.tests.client.Pair) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 Pair (org.alfresco.rest.api.tests.client.Pair)1 RequestContext (org.alfresco.rest.api.tests.client.RequestContext)1 Test (org.junit.Test)1