AnnotatedMethodScanner { synchronized Set<BeanDefinition> findCandidateBeans(String scanBase, Class<? extends Annotation> annotatedClass) { provider.resetFilters(false); provider.addIncludeFilter(new AnnotatedMethodFilter(annotatedClass)); String basePackage = scanBase.replace('.', '/'); return provider.findCandidateComponents(basePackage); } AnnotatedMethodScanner();   AnnotatedMethodScanner(ClassLoader classLoader, ClassPathScanningCandidateComponentProvider provider); Set<Method> findAnnotatedMethods(String scanBase, Class<? extends Annotation> annotationClass);  }
@Test public void testFindCandidateBeansAppliesAnnotatedMethodFilter() { String basePackage = "faux.package"; Set<BeanDefinition> filteredComponents = new HashSet<BeanDefinition>(); mockProvider.resetFilters(false); expectLastCall(); mockProvider.addIncludeFilter(EasyMock.isA(AnnotatedMethodFilter.class)); expectLastCall(); expect(mockProvider.findCandidateComponents(eq(basePackage.replace('.', '/')))). andReturn(filteredComponents); replayMocks(); impl.findCandidateBeans(basePackage, SomeAnno.class); verifyMocks(); }