### Question:
WebClassesFinder extends AbstractClassFinder { @Override public void findClasses(ClassVisitor visitor) { try { URL classesFolderUrl = servletContext.getResource(CLASSES_FOLDER); if (classesFolderUrl == null) { log.warn("Cannot find classes folder: " + CLASSES_FOLDER); return; } processDirectory(classesFolderUrl, CLASSES_FOLDER, visitor); } catch (MalformedURLException e) { throw new IllegalStateException("Invalid URL: " + e.getMessage(), e); } } WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter,
            ByteCodeFilter byteCodeFilter); @Override void findClasses(ClassVisitor visitor); @Override int priority();  }### Answer:
@Test public void testWebClassesFinderWithJettyRunGoal() throws Exception { URL classesUrl = new URL("file:/somewhere/myproject/target/classes/"); URL packageUrl = new URL("file:/somewhere/myproject/target/classes/package/"); URL classUrl = new URL("file:/somewhere/myproject/target/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); }