@Test
public void findRestClasses() throws Exception {

    WebApp webApp = new WebApp();
    webApp.setContextRoot("/");
    webApp.setId("web");
    webApp.setVersion("2.5");
    WebModule webModule = new WebModule(webApp, webApp.getContextRoot(), Thread.currentThread().getContextClassLoader(), "myapp", webApp.getId());
    webModule.setFinder(new AnnotationFinder(new ClassesArchive(RESTClass.class, RESTMethod.class, RESTApp.class)).link());
    AnnotationDeployer annotationDeployer = new AnnotationDeployer();
    webModule = annotationDeployer.deploy(webModule);
    Set<String> classes = webModule.getRestClasses();
    Set<String> applications = webModule.getRestApplications();
    assertEquals(2, classes.size());
    assertTrue(classes.contains(RESTClass.class.getName()));
    assertTrue(classes.contains(RESTMethod.class.getName()));
    assertEquals(1, applications.size());
    assertEquals(RESTApp.class.getName(), applications.iterator().next());
}