use of org.keycloak.testsuite.arquillian.undertow.saml.util.RestSamlApplicationConfig in project keycloak by keycloak.
the class UndertowAppServer method discoverPathAnnotatedClasses.
private ResteasyDeployment discoverPathAnnotatedClasses(WebArchive webArchive) {
// take all classes from war and add those with @Path annotation to RestSamlApplicationConfig
Set<Class<?>> classes = webArchive.getContent(archivePath -> archivePath.get().startsWith("/WEB-INF/classes/") && archivePath.get().endsWith(".class")).values().stream().filter(node -> node.getAsset() instanceof ClassAsset).map(node -> ((ClassAsset) node.getAsset()).getSource()).filter(clazz -> clazz.isAnnotationPresent(Path.class)).collect(Collectors.toSet());
ResteasyDeployment deployment = new ResteasyDeployment();
deployment.setApplication(new RestSamlApplicationConfig(classes));
return deployment;
}
Aggregations