Search in sources :

Example 21 with JAXRSArchive

use of org.wildfly.swarm.jaxrs.JAXRSArchive in project wildfly-swarm by wildfly-swarm.

the class SwaggerArchivePreparerTest method testWithoutSwaggerConf.

@Test
public void testWithoutSwaggerConf() {
    JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class);
    archive.addResource(MyResource.class);
    archive.addResource(MyOtherResource.class);
    SwaggerArchivePreparer preparer = new SwaggerArchivePreparer(archive);
    preparer.process();
    SwaggerArchive swaggerArchive = archive.as(SwaggerArchive.class);
    assertThat(swaggerArchive.getResourcePackages()).containsOnly("com.myapp");
}
Also used : JAXRSArchive(org.wildfly.swarm.jaxrs.JAXRSArchive) SwaggerArchive(org.wildfly.swarm.swagger.SwaggerArchive) Test(org.junit.Test)

Aggregations

JAXRSArchive (org.wildfly.swarm.jaxrs.JAXRSArchive)21 Test (org.junit.Test)12 AnnotationNode (org.objectweb.asm.tree.AnnotationNode)7 ClassNode (org.objectweb.asm.tree.ClassNode)7 File (java.io.File)6 Node (org.jboss.shrinkwrap.api.Node)6 Deployment (org.jboss.arquillian.container.test.api.Deployment)5 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)4 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)3 SwaggerArchive (org.wildfly.swarm.swagger.SwaggerArchive)3 Files (java.nio.file.Files)2 TemporalField (java.time.temporal.TemporalField)2 Assertions.assertThat (org.fest.assertions.Assertions.assertThat)2 ShrinkWrap (org.jboss.shrinkwrap.api.ShrinkWrap)2 ByteArrayAsset (org.jboss.shrinkwrap.api.asset.ByteArrayAsset)2 EmptyAsset (org.jboss.shrinkwrap.api.asset.EmptyAsset)2 ExplodedExporter (org.jboss.shrinkwrap.api.exporter.ExplodedExporter)2 ZipExporter (org.jboss.shrinkwrap.api.exporter.ZipExporter)2 After (org.junit.After)2 TempFileManager (org.wildfly.swarm.bootstrap.util.TempFileManager)2