Search in sources :

Example 1 with JerseySupport

use of io.helidon.webserver.jersey.JerseySupport in project helidon by oracle.

the class JerseyPropertiesTest method testIgnoreExceptionResponseOverride.

@Test
void testIgnoreExceptionResponseOverride() {
    JerseySupport jerseySupport = JerseySupport.builder().config(config).build();
    assertNotNull(jerseySupport);
    assertThat(System.getProperty(IGNORE_EXCEPTION_RESPONSE), is("false"));
}
Also used : JerseySupport(io.helidon.webserver.jersey.JerseySupport) HelidonTest(io.helidon.microprofile.tests.junit5.HelidonTest) Test(org.junit.jupiter.api.Test)

Example 2 with JerseySupport

use of io.helidon.webserver.jersey.JerseySupport in project helidon by oracle.

the class ServerCdiExtension method addApplication.

private void addApplication(JaxRsCdiExtension jaxRs, JaxRsApplication applicationMeta, InjectionManager injectionManager) {
    LOGGER.info("Registering JAX-RS Application: " + applicationMeta.appName());
    Optional<String> contextRoot = jaxRs.findContextRoot(config, applicationMeta);
    Optional<String> namedRouting = jaxRs.findNamedRouting(config, applicationMeta);
    boolean routingNameRequired = jaxRs.isNamedRoutingRequired(config, applicationMeta);
    if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest("Application " + applicationMeta.appName() + ", class: " + applicationMeta.appClassName() + ", contextRoot: " + contextRoot + ", namedRouting: " + namedRouting + ", routingNameRequired: " + routingNameRequired);
    }
    Routing.Builder routing = routingBuilder(namedRouting, routingNameRequired, applicationMeta.appName());
    JerseySupport jerseySupport = jaxRs.toJerseySupport(jaxRsExecutorService, applicationMeta, injectionManager);
    if (contextRoot.isPresent()) {
        String contextRootString = contextRoot.get();
        LOGGER.fine(() -> "JAX-RS application " + applicationMeta.appName() + " registered on '" + contextRootString + "'");
        routing.register(contextRootString, jerseySupport);
    } else {
        LOGGER.fine(() -> "JAX-RS application " + applicationMeta.appName() + " registered on '/'");
        routing.register(jerseySupport);
    }
    jerseySupports.add(jerseySupport);
}
Also used : Routing(io.helidon.webserver.Routing) JerseySupport(io.helidon.webserver.jersey.JerseySupport)

Aggregations

JerseySupport (io.helidon.webserver.jersey.JerseySupport)2 HelidonTest (io.helidon.microprofile.tests.junit5.HelidonTest)1 Routing (io.helidon.webserver.Routing)1 Test (org.junit.jupiter.api.Test)1