@Test public void testApplicationPathAnnotation_None_And_ChangeThePath() throws Exception { String applicationPath = "/api"; JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class); DefaultApplicationDeploymentProcessor processor = new DefaultApplicationDeploymentProcessor(archive); processor.applicationPath.set(applicationPath); processor.process(); try (InputStream in = archive.get(PATH).getAsset().openStream()) { ClassReader reader = new ClassReader(in); ClassNode node = new ClassNode(); reader.accept(node, 0); List<AnnotationNode> visibleAnnotations = node.visibleAnnotations; assertThat(visibleAnnotations.size()).isEqualTo(1); assertThat(visibleAnnotations.get(0).values).contains(applicationPath); } catch (IOException ignored) { } }
@Override public void process() throws Exception { if (this.deploymentContext != null && this.deploymentContext.isImplicit()) { return; } if (!archive.getName().endsWith(".war")) { return; } if (hasApplicationPathOrServletMapping(archive)) { return; } if (applicationPath.isExplicit()) { addGeneratedApplication(archive.as(JAXRSArchive.class)); } }
DefaultApplicationDeploymentProcessor implements DeploymentProcessor { @Override public void process() throws Exception { if (this.deploymentContext != null && this.deploymentContext.isImplicit()) { return; } if (!archive.getName().endsWith(".war")) { return; } if (hasApplicationPathOrServletMapping(archive)) { return; } if (applicationPath.isExplicit()) { addGeneratedApplication(archive.as(JAXRSArchive.class)); } } }
DefaultApplicationDeploymentProcessor implements DeploymentProcessor { @Override public void process() throws Exception { if (this.deploymentContext != null && this.deploymentContext.isImplicit()) { return; } if (!archive.getName().endsWith(".war")) { return; } if (hasApplicationPathOrServletMapping(archive)) { return; } if (applicationPath.isExplicit()) { addGeneratedApplication(archive.as(JAXRSArchive.class)); } } @Inject  DefaultApplicationDeploymentProcessor(Archive archive); }
DefaultApplicationDeploymentProcessor implements DeploymentProcessor { @Override public void process() throws Exception { if (this.deploymentContext != null && this.deploymentContext.isImplicit()) { return; } if (!archive.getName().endsWith(".war")) { return; } if (hasApplicationPathOrServletMapping(archive)) { return; } if (applicationPath.isExplicit()) { addGeneratedApplication(archive.as(JAXRSArchive.class)); } } @Inject  DefaultApplicationDeploymentProcessor(Archive archive); @Override void process(); }
DefaultApplicationDeploymentProcessor implements DeploymentProcessor { @Override public void process() throws Exception { if (this.deploymentContext != null && this.deploymentContext.isImplicit()) { return; } if (!archive.getName().endsWith(".war")) { return; } if (hasApplicationPathOrServletMapping(archive)) { return; } if (applicationPath.isExplicit()) { addGeneratedApplication(archive.as(JAXRSArchive.class)); } } @Inject  DefaultApplicationDeploymentProcessor(Archive archive); @Override void process();  }