AnnotatedMethodFilter implements TypeFilter { public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException { AnnotationMetadata annotationMetadata = metadataReader.getAnnotationMetadata(); Set<MethodMetadata> annotatedMethods = annotationMetadata .getAnnotatedMethods(annotatedClass.getCanonicalName()); return !annotatedMethods.isEmpty(); } AnnotatedMethodFilter(Class<? extends Annotation> annotatedClass); boolean match(MetadataReader metadataReader,
            MetadataReaderFactory metadataReaderFactory);  }
@Test public void testMatchReturnsFalseIfNoAnnotatedMethodsFound() throws IOException { Set<MethodMetadata> foundMethods = new HashSet<MethodMetadata>(); expect(mockAnnotationMetadata.getAnnotatedMethods(SomeAnno.class.getCanonicalName())).andReturn(foundMethods); replayMocks(); assertFalse(impl.match(mockMetadataReader, mockMetadataReaderFactory)); verifyMocks(); }
@Test public void testMatchReturnsFalseIfAnnotatedMethodsFound() throws IOException { Set<MethodMetadata> foundMethods = new HashSet<MethodMetadata>(); foundMethods.add(mockMethodMetadata); expect(mockAnnotationMetadata.getAnnotatedMethods(SomeAnno.class.getCanonicalName())).andReturn(foundMethods); replayMocks(); assertTrue(impl.match(mockMetadataReader, mockMetadataReaderFactory)); verifyMocks(); }