@Test public void testGetSubjectAttributesSupplementalAttributesOnly() { Set<Attribute> supplementalSubjectAttributes = new HashSet<>(); supplementalSubjectAttributes.add(new Attribute("https: SubjectAttributeResolver resolver = new SubjectAttributeResolver(this.defaultSubjectAttributeReader, this.testSubject.getSubjectIdentifier(), supplementalSubjectAttributes); Set<Attribute> combinedSubjectAttributes = resolver.getResult(null); Assert.assertNotNull(combinedSubjectAttributes); Assert.assertTrue(combinedSubjectAttributes.containsAll(supplementalSubjectAttributes)); }
public Set<Attribute> getResult(final Set<Attribute> scopes) { Set<Attribute> subjectAttributes = this.subjectAttributeMap.get(this.subjectIdentifier); if (null == subjectAttributes) { subjectAttributes = new HashSet<>( this.subjectAttributeReader.getAttributesByScope(this.subjectIdentifier, scopes)); subjectAttributes.addAll(this.supplementalSubjectAttributes); this.subjectAttributeMap.put(this.subjectIdentifier, subjectAttributes); } return subjectAttributes; }
SubjectAttributeResolver { public Set<Attribute> getResult(final Set<Attribute> scopes) { Set<Attribute> subjectAttributes = this.subjectAttributeMap.get(this.subjectIdentifier); if (null == subjectAttributes) { subjectAttributes = new HashSet<>( this.subjectAttributeReader.getAttributesByScope(this.subjectIdentifier, scopes)); subjectAttributes.addAll(this.supplementalSubjectAttributes); this.subjectAttributeMap.put(this.subjectIdentifier, subjectAttributes); } return subjectAttributes; } }
SubjectAttributeResolver { public Set<Attribute> getResult(final Set<Attribute> scopes) { Set<Attribute> subjectAttributes = this.subjectAttributeMap.get(this.subjectIdentifier); if (null == subjectAttributes) { subjectAttributes = new HashSet<>( this.subjectAttributeReader.getAttributesByScope(this.subjectIdentifier, scopes)); subjectAttributes.addAll(this.supplementalSubjectAttributes); this.subjectAttributeMap.put(this.subjectIdentifier, subjectAttributes); } return subjectAttributes; } SubjectAttributeResolver(final SubjectAttributeReader subjectAttributeReader, final String subjectIdentifier,
            final Set<Attribute> supplementalSubjectAttributes); }
SubjectAttributeResolver { public Set<Attribute> getResult(final Set<Attribute> scopes) { Set<Attribute> subjectAttributes = this.subjectAttributeMap.get(this.subjectIdentifier); if (null == subjectAttributes) { subjectAttributes = new HashSet<>( this.subjectAttributeReader.getAttributesByScope(this.subjectIdentifier, scopes)); subjectAttributes.addAll(this.supplementalSubjectAttributes); this.subjectAttributeMap.put(this.subjectIdentifier, subjectAttributes); } return subjectAttributes; } SubjectAttributeResolver(final SubjectAttributeReader subjectAttributeReader, final String subjectIdentifier,
            final Set<Attribute> supplementalSubjectAttributes); Set<Attribute> getResult(final Set<Attribute> scopes); }
SubjectAttributeResolver { public Set<Attribute> getResult(final Set<Attribute> scopes) { Set<Attribute> subjectAttributes = this.subjectAttributeMap.get(this.subjectIdentifier); if (null == subjectAttributes) { subjectAttributes = new HashSet<>( this.subjectAttributeReader.getAttributesByScope(this.subjectIdentifier, scopes)); subjectAttributes.addAll(this.supplementalSubjectAttributes); this.subjectAttributeMap.put(this.subjectIdentifier, subjectAttributes); } return subjectAttributes; } SubjectAttributeResolver(final SubjectAttributeReader subjectAttributeReader, final String subjectIdentifier,
            final Set<Attribute> supplementalSubjectAttributes); Set<Attribute> getResult(final Set<Attribute> scopes);  }