Search in sources :

Example 6 with ResourceSetResponse

use of org.xdi.oxauth.model.uma.ResourceSetResponse in project oxAuth by GluuFederation.

the class RegisterResourceSetFlowHttpTest method testModifyNotExistingResourceSet.

/**
     * Test non existing UMA resource set description modification
     */
@Test(dependsOnMethods = { "testModifyResourceSet" })
public void testModifyNotExistingResourceSet() throws Exception {
    showTitle("testModifyNotExistingResourceSet");
    ResourceSetRegistrationService resourceSetRegistrationService = UmaClientFactory.instance().createResourceSetRegistrationService(this.metadataConfiguration);
    // Modify resource set description with non existing Id
    ResourceSetResponse resourceSetStatus = null;
    try {
        ResourceSet resourceSet = new ResourceSet();
        resourceSet.setName("Photo Album 3");
        resourceSet.setIconUri("http://www.example.com/icons/flower.png");
        resourceSet.setScopes(Arrays.asList("http://photoz.example.com/dev/scopes/view", "http://photoz.example.com/dev/scopes/all"));
        resourceSetStatus = resourceSetRegistrationService.updateResourceSet("Bearer " + m_pat.getAccessToken(), this.resourceSetId, resourceSet);
    } catch (ClientResponseFailure ex) {
        System.err.println(ex.getResponse().getEntity(String.class));
        assertEquals(ex.getResponse().getStatus(), Response.Status.NOT_FOUND.getStatusCode(), "Unexpected response status");
    }
    assertNull(resourceSetStatus, "Resource set status is not null");
}
Also used : ResourceSetRegistrationService(org.xdi.oxauth.client.uma.ResourceSetRegistrationService) ResourceSetResponse(org.xdi.oxauth.model.uma.ResourceSetResponse) ResourceSet(org.xdi.oxauth.model.uma.ResourceSet) ClientResponseFailure(org.jboss.resteasy.client.ClientResponseFailure) Test(org.testng.annotations.Test) BaseTest(org.xdi.oxauth.BaseTest)

Aggregations

ResourceSetResponse (org.xdi.oxauth.model.uma.ResourceSetResponse)6 ResourceSet (org.xdi.oxauth.model.uma.ResourceSet)5 ClientResponseFailure (org.jboss.resteasy.client.ClientResponseFailure)4 Test (org.testng.annotations.Test)4 BaseTest (org.xdi.oxauth.BaseTest)4 ResourceSetRegistrationService (org.xdi.oxauth.client.uma.ResourceSetRegistrationService)4 AuthorizationGrant (org.xdi.oxauth.model.common.AuthorizationGrant)1