You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2017/10/31 14:17:09 UTC
[3/4] syncope git commit: [SYNCOPE-152] Implementations for
/ServiceProviderConfig /ResourceTypes and /Schemas - still static
http://git-wip-us.apache.org/repos/asf/syncope/blob/f04ab6c2/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/AddETagFilter.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/AddETagFilter.java b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/AddETagFilter.java
new file mode 100644
index 0000000..498ea95
--- /dev/null
+++ b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/AddETagFilter.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.ext.scimv2.cxf;
+
+import java.io.IOException;
+import java.util.Date;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+import javax.ws.rs.core.EntityTag;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.ext.Provider;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.ext.scimv2.api.data.SCIMGroup;
+import org.apache.syncope.ext.scimv2.api.data.SCIMUser;
+
+@Provider
+public class AddETagFilter implements ContainerResponseFilter {
+
+ @Override
+ public void filter(final ContainerRequestContext reqCtx, final ContainerResponseContext resCtx) throws IOException {
+ if (resCtx.getEntityTag() == null) {
+ Date lastModified = null;
+ if (resCtx.getEntity() instanceof SCIMUser) {
+ lastModified = ((SCIMUser) resCtx.getEntity()).getMeta().getLastModified();
+ if (resCtx.getEntity() instanceof SCIMGroup) {
+ lastModified = ((SCIMGroup) resCtx.getEntity()).getMeta().getLastModified();
+ }
+
+ if (lastModified != null) {
+ String etagValue = String.valueOf(lastModified.getTime());
+ if (StringUtils.isNotBlank(etagValue)) {
+ resCtx.getHeaders().add(HttpHeaders.ETAG, new EntityTag(etagValue).toString());
+ }
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/f04ab6c2/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/AbstractSCIMService.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/AbstractSCIMService.java b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/AbstractSCIMService.java
index 1ea3675..cd31e1f 100644
--- a/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/AbstractSCIMService.java
+++ b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/AbstractSCIMService.java
@@ -47,7 +47,7 @@ import org.apache.syncope.ext.scimv2.api.data.SCIMResource;
import org.apache.syncope.ext.scimv2.api.data.SCIMUser;
import org.apache.syncope.ext.scimv2.api.service.SCIMService;
import org.apache.syncope.ext.scimv2.api.type.Function;
-import org.apache.syncope.ext.scimv2.api.type.ResourceType;
+import org.apache.syncope.ext.scimv2.api.type.Resource;
import org.apache.syncope.ext.scimv2.api.type.SortOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -84,7 +84,7 @@ abstract class AbstractSCIMService<R extends SCIMResource> implements SCIMServic
return groupLogic;
}
- protected AbstractAnyLogic<?, ?> anyLogic(final ResourceType type) {
+ protected AbstractAnyLogic<?, ?> anyLogic(final Resource type) {
switch (type) {
case User:
return userLogic();
@@ -100,11 +100,12 @@ abstract class AbstractSCIMService<R extends SCIMResource> implements SCIMServic
protected SCIMUser toSCIMUser(final UserTO userTO, final String location) {
SCIMUser user = new SCIMUser(
userTO.getKey(),
- Collections.singletonList(ResourceType.User.getSchema()),
+ Collections.singletonList(Resource.User.schema()),
new Meta(
- ResourceType.User,
+ Resource.User,
userTO.getCreationDate(),
- userTO.getLastChangeDate(),
+ userTO.getLastChangeDate() == null
+ ? userTO.getCreationDate() : userTO.getLastChangeDate(),
userTO.getETagValue(),
location),
userTO.getUsername(),
@@ -135,11 +136,12 @@ abstract class AbstractSCIMService<R extends SCIMResource> implements SCIMServic
protected SCIMGroup toSCIMGroup(final GroupTO groupTO, final String location) {
SCIMGroup group = new SCIMGroup(
groupTO.getKey(),
- Collections.singletonList(ResourceType.Group.getSchema()),
+ Collections.singletonList(Resource.Group.schema()),
new Meta(
- ResourceType.Group,
+ Resource.Group,
groupTO.getCreationDate(),
- groupTO.getLastChangeDate(),
+ groupTO.getLastChangeDate() == null
+ ? groupTO.getCreationDate() : groupTO.getLastChangeDate(),
groupTO.getETagValue(),
location),
groupTO.getName());
@@ -166,7 +168,7 @@ abstract class AbstractSCIMService<R extends SCIMResource> implements SCIMServic
userTO.getKey(),
StringUtils.substringBefore(location, "/Groups") + "/Users/" + userTO.getKey(),
userTO.getUsername(),
- ResourceType.User));
+ Resource.User));
});
}
@@ -175,7 +177,7 @@ abstract class AbstractSCIMService<R extends SCIMResource> implements SCIMServic
@SuppressWarnings("unchecked")
protected ListResponse<R> doSearch(
- final ResourceType type,
+ final Resource type,
final Integer startIndex,
final Integer count,
final String filter,
http://git-wip-us.apache.org/repos/asf/syncope/blob/f04ab6c2/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/GroupServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/GroupServiceImpl.java b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/GroupServiceImpl.java
index 151762a..85b9198 100644
--- a/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/GroupServiceImpl.java
+++ b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/GroupServiceImpl.java
@@ -24,7 +24,7 @@ import javax.ws.rs.core.Response;
import org.apache.syncope.ext.scimv2.api.data.ListResponse;
import org.apache.syncope.ext.scimv2.api.data.SCIMGroup;
import org.apache.syncope.ext.scimv2.api.service.GroupService;
-import org.apache.syncope.ext.scimv2.api.type.ResourceType;
+import org.apache.syncope.ext.scimv2.api.type.Resource;
import org.apache.syncope.ext.scimv2.api.type.SortOrder;
public class GroupServiceImpl extends AbstractSCIMService<SCIMGroup> implements GroupService {
@@ -65,7 +65,7 @@ public class GroupServiceImpl extends AbstractSCIMService<SCIMGroup> implements
final SortOrder sortOrder,
final List<String> attributes) {
- return doSearch(ResourceType.Group, startIndex, count, filter, sortBy, sortOrder, attributes);
+ return doSearch(Resource.Group, startIndex, count, filter, sortBy, sortOrder, attributes);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/f04ab6c2/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/RootServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/RootServiceImpl.java b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/RootServiceImpl.java
index 0172e7d..6038f2b 100644
--- a/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/RootServiceImpl.java
+++ b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/RootServiceImpl.java
@@ -18,24 +18,51 @@
*/
package org.apache.syncope.ext.scimv2.cxf.service;
+import java.util.List;
import javax.ws.rs.core.Response;
+import org.apache.syncope.core.logic.RootLogic;
+import org.apache.syncope.core.spring.ApplicationContextProvider;
+import org.apache.syncope.ext.scimv2.api.data.ResourceType;
+import org.apache.syncope.ext.scimv2.api.data.SCIMResource;
+import org.apache.syncope.ext.scimv2.api.data.ServiceProviderConfig;
import org.apache.syncope.ext.scimv2.api.service.RootService;
-public class RootServiceImpl extends AbstractSCIMService implements RootService {
+public class RootServiceImpl extends AbstractSCIMService<SCIMResource> implements RootService {
+
+ private RootLogic rootLogic;
+
+ protected RootLogic rootLogic() {
+ synchronized (this) {
+ if (rootLogic == null) {
+ rootLogic = ApplicationContextProvider.getApplicationContext().getBean(RootLogic.class);
+ }
+ }
+ return rootLogic;
+ }
@Override
- public Response serviceProviderConfigs() {
- return Response.ok().build();
+ public ServiceProviderConfig serviceProviderConfig() {
+ return rootLogic().serviceProviderConfig();
}
@Override
- public Response resourceTypes() {
- return Response.ok().build();
+ public List<ResourceType> resourceTypes() {
+ return rootLogic().resourceTypes(uriInfo.getAbsolutePathBuilder());
+ }
+
+ @Override
+ public ResourceType resourceType(final String type) {
+ return rootLogic().resourceType(uriInfo.getAbsolutePathBuilder(), type);
}
@Override
public Response schemas() {
- return Response.ok().build();
+ return Response.ok(rootLogic().schemas()).build();
+ }
+
+ @Override
+ public Response schema(final String schema) {
+ return Response.ok(rootLogic().schema(schema)).build();
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/f04ab6c2/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/UserServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/UserServiceImpl.java b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/UserServiceImpl.java
index 6d51ca3..c12ed6c 100644
--- a/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/UserServiceImpl.java
+++ b/ext/scimv2/scim-rest-cxf/src/main/java/org/apache/syncope/ext/scimv2/cxf/service/UserServiceImpl.java
@@ -24,7 +24,7 @@ import javax.ws.rs.core.Response;
import org.apache.syncope.ext.scimv2.api.data.ListResponse;
import org.apache.syncope.ext.scimv2.api.data.SCIMUser;
import org.apache.syncope.ext.scimv2.api.service.UserService;
-import org.apache.syncope.ext.scimv2.api.type.ResourceType;
+import org.apache.syncope.ext.scimv2.api.type.Resource;
import org.apache.syncope.ext.scimv2.api.type.SortOrder;
public class UserServiceImpl extends AbstractSCIMService<SCIMUser> implements UserService {
@@ -65,6 +65,6 @@ public class UserServiceImpl extends AbstractSCIMService<SCIMUser> implements Us
final SortOrder sortOrder,
final List<String> attributes) {
- return doSearch(ResourceType.User, startIndex, count, filter, sortBy, sortOrder, attributes);
+ return doSearch(Resource.User, startIndex, count, filter, sortBy, sortOrder, attributes);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/f04ab6c2/ext/scimv2/scim-rest-cxf/src/main/resources/restSCIMv2CXFContext.xml
----------------------------------------------------------------------
diff --git a/ext/scimv2/scim-rest-cxf/src/main/resources/restSCIMv2CXFContext.xml b/ext/scimv2/scim-rest-cxf/src/main/resources/restSCIMv2CXFContext.xml
index 7293b26..ebbbe6e 100644
--- a/ext/scimv2/scim-rest-cxf/src/main/resources/restSCIMv2CXFContext.xml
+++ b/ext/scimv2/scim-rest-cxf/src/main/resources/restSCIMv2CXFContext.xml
@@ -49,6 +49,8 @@ under the License.
<property name="force" value="true"/>
</bean>
+ <bean id="addETagFilter" class="org.apache.syncope.ext.scimv2.cxf.AddETagFilter"/>
+
<bean id="wadlGenerator" class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
<property name="applicationTitle" value="Apache Syncope SCIMv2 ${syncope.version}"/>
<property name="namespacePrefix" value="syncope2"/>
@@ -76,6 +78,7 @@ under the License.
</jaxrs:outInterceptors>
<jaxrs:providers>
<ref bean="jsonProvider"/>
+ <ref bean="addETagFilter"/>
<ref bean="wadlGenerator"/>
</jaxrs:providers>
</jaxrs:server>
http://git-wip-us.apache.org/repos/asf/syncope/blob/f04ab6c2/fit/core-reference/src/main/resources/all/scimv2-logic.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/all/scimv2-logic.properties b/fit/core-reference/src/main/resources/all/scimv2-logic.properties
new file mode 100644
index 0000000..2d85a37
--- /dev/null
+++ b/fit/core-reference/src/main/resources/all/scimv2-logic.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+conf.directory=${conf.directory}
+
+bulk.maxOperations=1000
+bulk.maxPayloadSize=1048576
+filter.maxResults=200
http://git-wip-us.apache.org/repos/asf/syncope/blob/f04ab6c2/fit/core-reference/src/test/java/org/apache/syncope/fit/SCIMDetector.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/SCIMDetector.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/SCIMDetector.java
index d236c7f..265e292 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/SCIMDetector.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/SCIMDetector.java
@@ -18,12 +18,8 @@
*/
package org.apache.syncope.fit;
-import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
-import javax.xml.bind.DatatypeConverter;
import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.syncope.ext.scimv2.api.SCIMConstants;
-import org.apache.syncope.fit.core.SCIMITCase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -33,16 +29,11 @@ public class SCIMDetector {
private static Boolean ENABLED;
- public static boolean isSCIMAvailable() {
+ public static boolean isSCIMAvailable(final WebClient webClient) {
synchronized (LOG) {
if (ENABLED == null) {
try {
- Response response = WebClient.create(SCIMITCase.SCIM_ADDRESS).path("ServiceProviderConfigs").
- accept(SCIMConstants.APPLICATION_SCIM_JSON_TYPE).
- header(HttpHeaders.AUTHORIZATION,
- "Basic " + DatatypeConverter.printBase64Binary(
- (AbstractITCase.ADMIN_UNAME + ":" + AbstractITCase.ADMIN_PWD).getBytes())).
- get();
+ Response response = webClient.path("ServiceProviderConfig").get();
ENABLED = response.getStatus() == 200;
} catch (Exception e) {
// ignore
http://git-wip-us.apache.org/repos/asf/syncope/blob/f04ab6c2/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SCIMITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SCIMITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SCIMITCase.java
index 04b0c6f..0e85639 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SCIMITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SCIMITCase.java
@@ -24,37 +24,102 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
import java.io.IOException;
-import java.io.InputStream;
+import java.util.Arrays;
+import java.util.List;
+import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.syncope.ext.scimv2.api.SCIMConstants;
import org.apache.syncope.ext.scimv2.api.data.ListResponse;
+import org.apache.syncope.ext.scimv2.api.data.ResourceType;
import org.apache.syncope.ext.scimv2.api.data.SCIMGroup;
import org.apache.syncope.ext.scimv2.api.data.SCIMUser;
+import org.apache.syncope.ext.scimv2.api.data.ServiceProviderConfig;
+import org.apache.syncope.ext.scimv2.api.type.Resource;
+import org.apache.syncope.ext.scimv2.cxf.JacksonSCIMJsonProvider;
import org.apache.syncope.fit.AbstractITCase;
import org.apache.syncope.fit.SCIMDetector;
import org.junit.jupiter.api.Test;
public class SCIMITCase extends AbstractITCase {
- public static final String SCIM_ADDRESS = "http://localhost:9080/syncope/scim";
-
- private static final ObjectMapper MAPPER = new ObjectMapper();
+ public static final String SCIM_ADDRESS = "http://localhost:9080/syncope/scim/v2";
private WebClient webClient() {
- return WebClient.create(SCIM_ADDRESS).
+ return WebClient.create(SCIM_ADDRESS, Arrays.asList(new JacksonSCIMJsonProvider())).
accept(SCIMConstants.APPLICATION_SCIM_JSON_TYPE).
header(HttpHeaders.AUTHORIZATION, "Bearer " + adminClient.getJWT());
}
@Test
+ public void serviceProviderConfig() {
+ assumeTrue(SCIMDetector.isSCIMAvailable(webClient()));
+
+ Response response = webClient().path("ServiceProviderConfig").get();
+ assertEquals(200, response.getStatus());
+ assertEquals(
+ SCIMConstants.APPLICATION_SCIM_JSON,
+ StringUtils.substringBefore(response.getHeaderString(HttpHeaders.CONTENT_TYPE), ";"));
+
+ ServiceProviderConfig serviceProviderConfig = response.readEntity(ServiceProviderConfig.class);
+ assertNotNull(serviceProviderConfig);
+ assertTrue(serviceProviderConfig.getEtag().isSupported());
+ }
+
+ @Test
+ public void resourceTypes() {
+ assumeTrue(SCIMDetector.isSCIMAvailable(webClient()));
+
+ Response response = webClient().path("ResourceTypes").get();
+ assertEquals(200, response.getStatus());
+ assertEquals(
+ SCIMConstants.APPLICATION_SCIM_JSON,
+ StringUtils.substringBefore(response.getHeaderString(HttpHeaders.CONTENT_TYPE), ";"));
+
+ List<ResourceType> resourceTypes = response.readEntity(new GenericType<List<ResourceType>>() {
+ });
+ assertNotNull(resourceTypes);
+ assertEquals(2, resourceTypes.size());
+
+ response = webClient().path("ResourceTypes").path("User").get();
+ assertEquals(200, response.getStatus());
+
+ ResourceType user = response.readEntity(ResourceType.class);
+ assertNotNull(user);
+ assertEquals(Resource.User.schema(), user.getSchema());
+ assertFalse(user.getSchemaExtensions().isEmpty());
+ }
+
+ @Test
+ public void schemas() {
+ assumeTrue(SCIMDetector.isSCIMAvailable(webClient()));
+
+ Response response = webClient().path("Schemas").get();
+ assertEquals(200, response.getStatus());
+ assertEquals(
+ SCIMConstants.APPLICATION_SCIM_JSON,
+ StringUtils.substringBefore(response.getHeaderString(HttpHeaders.CONTENT_TYPE), ";"));
+
+ ArrayNode schemas = response.readEntity(ArrayNode.class);
+ assertNotNull(schemas);
+ assertEquals(3, schemas.size());
+
+ response = webClient().path("Schemas").path(Resource.EnterpriseUser.schema()).get();
+ assertEquals(200, response.getStatus());
+
+ ObjectNode enterpriseUser = response.readEntity(ObjectNode.class);
+ assertNotNull(enterpriseUser);
+ assertEquals(Resource.EnterpriseUser.schema(), enterpriseUser.get("id").textValue());
+ }
+
+ @Test
public void read() throws IOException {
- assumeTrue(SCIMDetector.isSCIMAvailable());
+ assumeTrue(SCIMDetector.isSCIMAvailable(webClient()));
Response response = webClient().path("Users").path("1417acbe-cbf6-4277-9372-e75e04f97000").get();
assertEquals(200, response.getStatus());
@@ -62,7 +127,7 @@ public class SCIMITCase extends AbstractITCase {
SCIMConstants.APPLICATION_SCIM_JSON,
StringUtils.substringBefore(response.getHeaderString(HttpHeaders.CONTENT_TYPE), ";"));
- SCIMUser user = MAPPER.readValue((InputStream) response.getEntity(), SCIMUser.class);
+ SCIMUser user = response.readEntity(SCIMUser.class);
assertNotNull(user);
assertEquals("1417acbe-cbf6-4277-9372-e75e04f97000", user.getId());
assertEquals("rossini", user.getUserName());
@@ -72,7 +137,7 @@ public class SCIMITCase extends AbstractITCase {
@Test
public void list() throws IOException {
- assumeTrue(SCIMDetector.isSCIMAvailable());
+ assumeTrue(SCIMDetector.isSCIMAvailable(webClient()));
Response response = webClient().path("Groups").get();
assertEquals(200, response.getStatus());
@@ -80,9 +145,7 @@ public class SCIMITCase extends AbstractITCase {
SCIMConstants.APPLICATION_SCIM_JSON,
StringUtils.substringBefore(response.getHeaderString(HttpHeaders.CONTENT_TYPE), ";"));
- ListResponse<SCIMGroup> result = MAPPER.readValue(
- (InputStream) response.getEntity(),
- new TypeReference<ListResponse<SCIMGroup>>() {
+ ListResponse<SCIMGroup> result = response.readEntity(new GenericType<ListResponse<SCIMGroup>>() {
});
assertNotNull(result);
assertTrue(result.getTotalResults() > 0);
http://git-wip-us.apache.org/repos/asf/syncope/blob/f04ab6c2/fit/core-reference/src/test/resources/rebel.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/rebel.xml b/fit/core-reference/src/test/resources/rebel.xml
index 6c508b0..c0f9331 100644
--- a/fit/core-reference/src/test/resources/rebel.xml
+++ b/fit/core-reference/src/test/resources/rebel.xml
@@ -95,6 +95,8 @@ under the License.
</dir>
<dir name="${basedir}/../../ext/scimv2/scim-rest-cxf/target/classes">
</dir>
+ <dir name="${basedir}/../../ext/scimv2/logic/target/classes">
+ </dir>
</classpath>
<web>