use of org.apereo.cas.services.util.RegisteredServiceJsonSerializer in project cas by apereo.
the class RegisteredServiceResourceTests method configureMockMvcFor.
private static MockMvc configureMockMvcFor(final RegisteredServiceResource registeredServiceResource) {
val sz = new RegisteredServiceJsonSerializer();
val converter = new MappingJackson2HttpMessageConverter(sz.getObjectMapper());
return MockMvcBuilders.standaloneSetup(registeredServiceResource).defaultRequest(get("/").contextPath("/cas").contentType(MediaType.APPLICATION_JSON)).setMessageConverters(converter).build();
}
use of org.apereo.cas.services.util.RegisteredServiceJsonSerializer in project cas by apereo.
the class SamlRegisteredServiceTests method verifySignAssertionFalseWithDeserialization.
@Test
public void verifySignAssertionFalseWithDeserialization() {
val json = "{\n" + " \"@class\" : \"org.apereo.cas.support.saml.services.SamlRegisteredService\",\n" + " \"serviceId\" : \"the-entity\",\n" + " \"name\" : \"SAMLService\",\n" + " \"id\" : 10000003,\n" + " \"evaluationOrder\" : 10,\n" + " \"signAssertions\" : false,\n" + " \"metadataLocation\" : \"https://url/to/metadata.xml\"\n" + '}';
val serializer = new RegisteredServiceJsonSerializer();
val service = (SamlRegisteredService) serializer.from(json);
assertNotNull(service);
assertTrue(service.getSignAssertions().isFalse());
}
use of org.apereo.cas.services.util.RegisteredServiceJsonSerializer in project cas by apereo.
the class OidcProfileScopeAttributeReleasePolicyTests method verifySerialization.
@Test
public void verifySerialization() {
val policy = new OidcProfileScopeAttributeReleasePolicy();
val chain = new ChainingAttributeReleasePolicy();
chain.addPolicy(policy);
val service = getOidcRegisteredService();
service.setAttributeReleasePolicy(chain);
val serializer = new RegisteredServiceJsonSerializer();
val json = serializer.toString(service);
assertNotNull(json);
assertNotNull(serializer.from(json));
}
use of org.apereo.cas.services.util.RegisteredServiceJsonSerializer in project cas by apereo.
the class OidcEmailScopeAttributeReleasePolicyTests method verifySerialization.
@Test
public void verifySerialization() {
val policy = new OidcEmailScopeAttributeReleasePolicy();
val chain = new ChainingAttributeReleasePolicy();
chain.addPolicy(policy);
val service = getOidcRegisteredService();
service.setAttributeReleasePolicy(chain);
val serializer = new RegisteredServiceJsonSerializer();
val json = serializer.toString(service);
assertNotNull(json);
assertNotNull(serializer.from(json));
}
use of org.apereo.cas.services.util.RegisteredServiceJsonSerializer in project cas by apereo.
the class OidcPhoneScopeAttributeReleasePolicyTests method verifySerialization.
@Test
public void verifySerialization() {
val policy = new OidcPhoneScopeAttributeReleasePolicy();
val chain = new ChainingAttributeReleasePolicy();
chain.addPolicy(policy);
val service = getOidcRegisteredService();
service.setAttributeReleasePolicy(chain);
val serializer = new RegisteredServiceJsonSerializer();
val json = serializer.toString(service);
assertNotNull(json);
assertNotNull(serializer.from(json));
}
Aggregations