ExternalSubjectAttributeReader extends ExternalAttributeReader implements SubjectAttributeReader { @Override public Set<Attribute> getAttributesByScope(final String subjectId, final Set<Attribute> scopes) { return this.getAttributes(subjectId); } ExternalSubjectAttributeReader(final AttributeConnectorService connectorService,
            final AttributeCache subjectAttributeCache, final int adapterTimeoutMillis); @Override Set<Attribute> getAttributesByScope(final String subjectId, final Set<Attribute> scopes);  }
@Test public void testGetAttributesByScope() throws Exception { Mockito.doReturn(this.expectedAdapterAttributes).when(this.externalSubjectAttributeReader) .getAttributesFromAdapters(IDENTIFIER); Set<Attribute> actualAttributes = this.externalSubjectAttributeReader.getAttributes(IDENTIFIER); Assert.assertEquals(this.expectedAdapterAttributes.getAttributes(), actualAttributes); actualAttributes = this.externalSubjectAttributeReader.getAttributesByScope(IDENTIFIER, Collections.singleton(new Attribute("test-issuer", "test-scope", "test-value"))); Assert.assertEquals(this.expectedAdapterAttributes.getAttributes(), actualAttributes); }