use of org.oxauth.persistence.model.ClientAttributes in project oxAuth by GluuFederation.
the class JsonApplierServerTest method transfer_fromRegisterRequestToClientAttribute_withListOfString_shouldTransferValueCorrectly.
@Test
public void transfer_fromRegisterRequestToClientAttribute_withListOfString_shouldTransferValueCorrectly() {
RegisterRequest request = new RegisterRequest();
request.setAdditionalAudience(Lists.newArrayList("aud1", "aud2"));
ClientAttributes attributes = new ClientAttributes();
JsonApplier.getInstance().transfer(request, attributes);
assertEquals(Lists.newArrayList("aud1", "aud2"), attributes.getAdditionalAudience());
}
use of org.oxauth.persistence.model.ClientAttributes in project oxAuth by GluuFederation.
the class JsonApplierServerTest method apply_fromClientAttributesToJSONObject_withListOfString_shouldTransferValueCorrectly.
@Test
public void apply_fromClientAttributesToJSONObject_withListOfString_shouldTransferValueCorrectly() {
ClientAttributes attributes = new ClientAttributes();
attributes.setAdditionalAudience(Lists.newArrayList("aud1", "aud2"));
JSONObject jsonObject = new JSONObject();
JsonApplier.getInstance().apply(attributes, jsonObject);
assertEquals(new JSONArray(Lists.newArrayList("aud1", "aud2")), jsonObject.getJSONArray("additional_audience"));
}
use of org.oxauth.persistence.model.ClientAttributes in project oxTrust by GluuFederation.
the class UpdateClientAction method saveAttributesJson.
private void saveAttributesJson() {
ClientAttributes clientAttributes = new ClientAttributes();
try {
clientAttributes = new ObjectMapper().readValue(this.oxAttributesJson, ClientAttributes.class);
} catch (Exception e) {
log.info("error parsing json:" + e);
}
clientAttributes.setPostAuthnScripts(postAuthnScripts.stream().map(CustomScript::getDn).collect(Collectors.toList()));
clientAttributes.setRptClaimsScripts(rptClaimsScripts.stream().map(CustomScript::getDn).collect(Collectors.toList()));
clientAttributes.setConsentGatheringScripts(consentScripts.stream().map(CustomScript::getDn).collect(Collectors.toList()));
clientAttributes.setSpontaneousScopeScriptDns(spontaneousScopesScripts.stream().map(CustomScript::getDn).collect(Collectors.toList()));
clientAttributes.setIntrospectionScripts(introspectionScripts.stream().map(CustomScript::getDn).collect(Collectors.toList()));
this.client.setAttributes(clientAttributes);
}
Aggregations