@Test public void testAttributeFor() { final EntityIdentifier parentEntityIdentifier = new EntityIdentifier("mock.group", IPerson.class); final String memberId = "mock.user"; final EntityIdentifier childEntityIdentifier = new EntityIdentifier(memberId, IPerson.class); final MembershipCacheKey membershipCacheKey = new MembershipCacheKey(parentEntityIdentifier, childEntityIdentifier); final Element element = new Element(membershipCacheKey, new Object()); final EhcacheMemberIdAttributeExtractor attributeExtractor = new EhcacheMemberIdAttributeExtractor(); Assert.assertEquals(attributeExtractor.attributeFor(element, null), memberId); }
@Override public Object attributeFor(Element element, String attributeName) throws AttributeExtractorException { final MembershipCacheKey membershipCacheKey = (MembershipCacheKey) element.getObjectKey(); final EntityIdentifier ei = membershipCacheKey.getMemberId(); return ei.getKey(); }
EhcacheMemberIdAttributeExtractor implements AttributeExtractor { @Override public Object attributeFor(Element element, String attributeName) throws AttributeExtractorException { final MembershipCacheKey membershipCacheKey = (MembershipCacheKey) element.getObjectKey(); final EntityIdentifier ei = membershipCacheKey.getMemberId(); return ei.getKey(); } }
EhcacheMemberIdAttributeExtractor implements AttributeExtractor { @Override public Object attributeFor(Element element, String attributeName) throws AttributeExtractorException { final MembershipCacheKey membershipCacheKey = (MembershipCacheKey) element.getObjectKey(); final EntityIdentifier ei = membershipCacheKey.getMemberId(); return ei.getKey(); }  }
EhcacheMemberIdAttributeExtractor implements AttributeExtractor { @Override public Object attributeFor(Element element, String attributeName) throws AttributeExtractorException { final MembershipCacheKey membershipCacheKey = (MembershipCacheKey) element.getObjectKey(); final EntityIdentifier ei = membershipCacheKey.getMemberId(); return ei.getKey(); }  @Override Object attributeFor(Element element, String attributeName); }
EhcacheMemberIdAttributeExtractor implements AttributeExtractor { @Override public Object attributeFor(Element element, String attributeName) throws AttributeExtractorException { final MembershipCacheKey membershipCacheKey = (MembershipCacheKey) element.getObjectKey(); final EntityIdentifier ei = membershipCacheKey.getMemberId(); return ei.getKey(); }  @Override Object attributeFor(Element element, String attributeName);  }