Search in sources :

Example 1 with IUserWebService

use of io.jans.scim.ws.rs.scim2.IUserWebService in project jans by JanssenProject.

the class SampleTest method smallerClient.

// This tests assumes client_secret_basic for token endpoint authentication
@Test
@Parameters({ "domainURL", "OIDCMetadataUrl", "clientId", "clientSecret" })
public void smallerClient(String domainURL, String OIDCMetadataUrl, String clientId, String clientSecret) throws Exception {
    IUserWebService myclient = ScimClientFactory.getClient(IUserWebService.class, domainURL, OIDCMetadataUrl, clientId, clientSecret, false);
    SearchRequest sr = new SearchRequest();
    sr.setFilter("userName eq \"admin\"");
    Response response = myclient.searchUsersPost(sr);
    assertEquals(response.getStatus(), OK.getStatusCode());
    UserResource u = (UserResource) response.readEntity(ListResponse.class).getResources().get(0);
    logger.debug("Hello {}!", u.getDisplayName());
}
Also used : Response(javax.ws.rs.core.Response) IUserWebService(io.jans.scim.ws.rs.scim2.IUserWebService) UserResource(io.jans.scim.model.scim2.user.UserResource) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test)

Aggregations

UserResource (io.jans.scim.model.scim2.user.UserResource)1 IUserWebService (io.jans.scim.ws.rs.scim2.IUserWebService)1 Response (javax.ws.rs.core.Response)1 Parameters (org.testng.annotations.Parameters)1 Test (org.testng.annotations.Test)1