@Test public void testWebClassesFinder() throws Exception { URL classesUrl = new URL("file:/somewhere/WEB-INF/classes/"); URL packageUrl = new URL("file:/somewhere/WEB-INF/classes/package/"); URL classUrl = new URL("file:/somewhere/WEB-INF/classes/package/TestClass.class"); Set<String> classesDirectory = new HashSet<String>(Arrays.asList("/WEB-INF/classes/package/")); Set<String> packageDirectory = new HashSet<String>(Arrays.asList("/WEB-INF/classes/package/TestClass.class")); PackageFilter filter = new PackageFilter(null); ServletContext servletContext = Mockito.mock(ServletContext.class); Mockito.when(servletContext.getResource("/WEB-INF/classes/")).thenReturn(classesUrl); Mockito.when(servletContext.getResourcePaths("/WEB-INF/classes/")).thenReturn(classesDirectory); Mockito.when(servletContext.getResource("/WEB-INF/classes/package/")).thenReturn(packageUrl); Mockito.when(servletContext.getResourcePaths("/WEB-INF/classes/package/")).thenReturn(packageDirectory); Mockito.when(servletContext.getResource("/WEB-INF/classes/package/TestClass.class")).thenReturn(classUrl); ClassLoader classLoader = Mockito.mock(ClassLoader.class); Mockito.when(classLoader.loadClass("package.TestClass")).thenReturn((Class) ClassFinderTestBean.class); Set<Class<? extends Annotation>> types = new HashSet<Class<? extends Annotation>>(); types.add(TestAnnotation.class); ByteCodeFilter byteCodeFilter = new ByteCodeFilter(types); ClassVisitor classVisitor = Mockito.mock(ClassVisitor.class); WebClassesFinder finder = new WebClassesFinder(servletContext, classLoader, filter, byteCodeFilter); finder.findClasses(classVisitor); Mockito.verify(classVisitor).visit(ClassFinderTestBean.class); }
public WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter, ByteCodeFilter byteCodeFilter) { super(servletContext, classLoader, packageFilter, byteCodeFilter); }
WebClassesFinder extends AbstractClassFinder { public WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter, ByteCodeFilter byteCodeFilter) { super(servletContext, classLoader, packageFilter, byteCodeFilter); } }
WebClassesFinder extends AbstractClassFinder { public WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter, ByteCodeFilter byteCodeFilter) { super(servletContext, classLoader, packageFilter, byteCodeFilter); } WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter,
            ByteCodeFilter byteCodeFilter); }
WebClassesFinder extends AbstractClassFinder { public WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter, ByteCodeFilter byteCodeFilter) { super(servletContext, classLoader, packageFilter, byteCodeFilter); } WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter,
            ByteCodeFilter byteCodeFilter); @Override void findClasses(ClassVisitor visitor); @Override int priority(); }
WebClassesFinder extends AbstractClassFinder { public WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter, ByteCodeFilter byteCodeFilter) { super(servletContext, classLoader, packageFilter, byteCodeFilter); } WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter,
            ByteCodeFilter byteCodeFilter); @Override void findClasses(ClassVisitor visitor); @Override int priority();  }