Search in sources :

Example 1 with WildFlyConfigBuilder

use of org.wildfly.microprofile.config.WildFlyConfigBuilder in project wildfly-swarm by wildfly-swarm.

the class ApimanManagerApiDeploymentTest method testApimanManagerWAR.

@Test
public void testApimanManagerWAR() throws Exception {
    File warFile = Maven.resolver().resolve("io.apiman:apiman-manager-api-war:war:1.3.1.Final").withoutTransitivity().asSingleFile();
    WildFlyConfigBuilder cfgBuilder = new WildFlyConfigBuilder();
    cfgBuilder.addDefaultSources();
    Config cfg = cfgBuilder.build();
    Archive archive = ShrinkWrap.createFromZipFile(JAXRSArchive.class, warFile);
    OpenApiConfig config = new OpenApiConfig(cfg);
    OpenApiDocument.INSTANCE.reset();
    OpenApiDeploymentProcessor processor = new OpenApiDeploymentProcessor(config, archive);
    processor.process();
    new OpenApiServletContextListener().contextInitialized(null);
    String actual = OpenApiSerializer.serialize(OpenApiDocument.INSTANCE.get(), Format.JSON);
    String expected = loadResource(getClass().getResource("testApimanManagerWAR.expected.json"));
    // System.out.println(actual);
    assertJsonEquals(expected, actual);
}
Also used : WildFlyConfigBuilder(org.wildfly.microprofile.config.WildFlyConfigBuilder) Archive(org.jboss.shrinkwrap.api.Archive) JAXRSArchive(org.wildfly.swarm.jaxrs.JAXRSArchive) OpenApiServletContextListener(org.wildfly.swarm.microprofile.openapi.deployment.OpenApiServletContextListener) OpenApiConfig(org.wildfly.swarm.microprofile.openapi.api.OpenApiConfig) Config(org.eclipse.microprofile.config.Config) OpenApiConfig(org.wildfly.swarm.microprofile.openapi.api.OpenApiConfig) File(java.io.File) Test(org.junit.Test)

Example 2 with WildFlyConfigBuilder

use of org.wildfly.microprofile.config.WildFlyConfigBuilder in project wildfly-swarm by wildfly-swarm.

the class ApimanManagerApiDeploymentTest method testApimanGatewayWAR.

@Test
public void testApimanGatewayWAR() throws Exception {
    File warFile = Maven.resolver().resolve("io.apiman:apiman-gateway-platforms-war-wildfly8-api:war:1.3.1.Final").withoutTransitivity().asSingleFile();
    WildFlyConfigBuilder cfgBuilder = new WildFlyConfigBuilder();
    cfgBuilder.addDefaultSources();
    Config cfg = cfgBuilder.build();
    Archive archive = ShrinkWrap.createFromZipFile(JAXRSArchive.class, warFile);
    OpenApiConfig config = new OpenApiConfig(cfg);
    OpenApiDocument.INSTANCE.reset();
    OpenApiDeploymentProcessor processor = new OpenApiDeploymentProcessor(config, archive);
    processor.process();
    new OpenApiServletContextListener().contextInitialized(null);
    String actual = OpenApiSerializer.serialize(OpenApiDocument.INSTANCE.get(), Format.JSON);
    String expected = loadResource(getClass().getResource("testApimanGatewayWAR.expected.json"));
    // System.out.println(actual);
    assertJsonEquals(expected, actual);
}
Also used : WildFlyConfigBuilder(org.wildfly.microprofile.config.WildFlyConfigBuilder) Archive(org.jboss.shrinkwrap.api.Archive) JAXRSArchive(org.wildfly.swarm.jaxrs.JAXRSArchive) OpenApiServletContextListener(org.wildfly.swarm.microprofile.openapi.deployment.OpenApiServletContextListener) OpenApiConfig(org.wildfly.swarm.microprofile.openapi.api.OpenApiConfig) Config(org.eclipse.microprofile.config.Config) OpenApiConfig(org.wildfly.swarm.microprofile.openapi.api.OpenApiConfig) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)2 Config (org.eclipse.microprofile.config.Config)2 Archive (org.jboss.shrinkwrap.api.Archive)2 Test (org.junit.Test)2 WildFlyConfigBuilder (org.wildfly.microprofile.config.WildFlyConfigBuilder)2 JAXRSArchive (org.wildfly.swarm.jaxrs.JAXRSArchive)2 OpenApiConfig (org.wildfly.swarm.microprofile.openapi.api.OpenApiConfig)2 OpenApiServletContextListener (org.wildfly.swarm.microprofile.openapi.deployment.OpenApiServletContextListener)2