@Test @SpecAssertions({@SpecAssertion(section = DECORATOR_INVOCATION, id = "acb")}) public void testDecoratorIsInvoked() { assertTrue(instance.isAmbiguous()); Mule mule = instance.get(); assertNotNull(mule); }
@Produces public ServletDescriptor jerseyServlet() { String urlPattern = restServerConfiguration.getRestServletMapping(); if (!applicationInstance.isUnsatisfied() && !applicationInstance.isAmbiguous()) { ApplicationPath annotation = ClassUtils.getAnnotation(applicationInstance.get().getClass(), ApplicationPath.class); if (annotation != null) { String path = annotation.value(); urlPattern = path.endsWith("/") ? path + "*" : path + "/*"; } } return new ServletDescriptor( SERVLET_NAME, null, new String[] {urlPattern}, 1, null, true, ServletContainer.class); }
@Override public Map<String, Object> getAttributes() { final ResourceConfig resourceConfig; if (!applicationInstance.isUnsatisfied() && !applicationInstance.isAmbiguous()) { resourceConfig = ResourceConfig.forApplication(applicationInstance.get()); } else { resourceConfig = new ResourceConfig(); } if (resourceConfig.getClasses().isEmpty()) { resourceConfig .registerClasses(jerseyCdiExtension.getProviders()) .registerClasses(jerseyCdiExtension.getResources()); } final String attributeName = RESOURCE_CONFIG + SERVLET_NAME; return singletonMap(attributeName, resourceConfig); }