@Test public void testIncludeAttributes() throws Exception { ScimUser resource = getScimUser(); debugJson(resource); Set<AttributeReference> attributes = new HashSet<>(); attributes.add(new AttributeReference("userName")); attributes.add(new AttributeReference("addresses.streetAddress")); resource = attributeUtil.setAttributesForDisplay(resource, attributes); debugJson(resource); Assertions.assertThat(resource.getUserName()).isNotNull(); Assertions.assertThat(resource.getId()).isNotNull(); Assertions.assertThat(resource.getPassword()).isNull(); Assertions.assertThat(resource.getActive()).isNull(); Assertions.assertThat(resource.getAddresses().get(0).getCountry()).isNull(); Assertions.assertThat(resource.getAddresses().get(0).getStreetAddress()).isNotNull(); EnterpriseExtension extension = resource.getExtension(EnterpriseExtension.class); Assertions.assertThat(extension).as("%s should have been removed from extensions", EnterpriseExtension.URN).isNull(); }
public <T extends ScimResource> T setAttributesForDisplay(T resource) throws IllegalArgumentException, IllegalAccessException, AttributeDoesNotExistException, IOException { return setAttributesForDisplayInternal(resource, Returned.REQUEST, Returned.NEVER); }
AttributeUtil { public <T extends ScimResource> T setAttributesForDisplay(T resource) throws IllegalArgumentException, IllegalAccessException, AttributeDoesNotExistException, IOException { return setAttributesForDisplayInternal(resource, Returned.REQUEST, Returned.NEVER); } }
AttributeUtil { public <T extends ScimResource> T setAttributesForDisplay(T resource) throws IllegalArgumentException, IllegalAccessException, AttributeDoesNotExistException, IOException { return setAttributesForDisplayInternal(resource, Returned.REQUEST, Returned.NEVER); }  }
AttributeUtil { public <T extends ScimResource> T setAttributesForDisplay(T resource) throws IllegalArgumentException, IllegalAccessException, AttributeDoesNotExistException, IOException { return setAttributesForDisplayInternal(resource, Returned.REQUEST, Returned.NEVER); }  @PostConstruct void init(); T keepAlwaysAttributesForDisplay(T resource); T setAttributesForDisplay(T resource); T setAttributesForDisplay(T resource, Set<AttributeReference> attributes); T setExcludedAttributesForDisplay(T resource, Set<AttributeReference> excludedAttributes); Set<AttributeReference> getAttributeReferences(String s); }
AttributeUtil { public <T extends ScimResource> T setAttributesForDisplay(T resource) throws IllegalArgumentException, IllegalAccessException, AttributeDoesNotExistException, IOException { return setAttributesForDisplayInternal(resource, Returned.REQUEST, Returned.NEVER); }  @PostConstruct void init(); T keepAlwaysAttributesForDisplay(T resource); T setAttributesForDisplay(T resource); T setAttributesForDisplay(T resource, Set<AttributeReference> attributes); T setExcludedAttributesForDisplay(T resource, Set<AttributeReference> excludedAttributes); Set<AttributeReference> getAttributeReferences(String s);  }