Search in sources :

Example 1 with JettyConfiguration

use of org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration in project DataSpaceConnector by eclipse-dataspaceconnector.

the class ContractDefinitionsApiControllerIntegrationTest method prepareWebserver.

@BeforeAll
static void prepareWebserver() {
    port = TestUtils.getFreePort();
    var monitor = mock(Monitor.class);
    var config = new JettyConfiguration(null, null);
    config.portMapping(new PortMapping("data", port, "/api/v1/data"));
    var jetty = new JettyService(config, monitor);
    var ctrl = new ContractDefinitionApiController(monitor);
    var jerseyService = new JerseyRestService(jetty, new TypeManager(), mock(CorsFilterConfiguration.class), monitor);
    jetty.start();
    jerseyService.registerResource("data", ctrl);
    jerseyService.start();
}
Also used : JerseyRestService(org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService) JettyConfiguration(org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration) TypeManager(org.eclipse.dataspaceconnector.spi.types.TypeManager) PortMapping(org.eclipse.dataspaceconnector.extension.jetty.PortMapping) CorsFilterConfiguration(org.eclipse.dataspaceconnector.extension.jersey.CorsFilterConfiguration) JettyService(org.eclipse.dataspaceconnector.extension.jetty.JettyService) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 2 with JettyConfiguration

use of org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration in project DataSpaceConnector by eclipse-dataspaceconnector.

the class PolicyApiControllerIntegrationTest method prepareWebserver.

@BeforeAll
static void prepareWebserver() {
    port = TestUtils.getFreePort();
    var monitor = mock(Monitor.class);
    var config = new JettyConfiguration(null, null);
    config.portMapping(new PortMapping("data", port, "/api/v1/data"));
    var jetty = new JettyService(config, monitor);
    var ctrl = new PolicyApiController(monitor);
    var jerseyService = new JerseyRestService(jetty, new TypeManager(), mock(CorsFilterConfiguration.class), monitor);
    jetty.start();
    jerseyService.registerResource("data", ctrl);
    jerseyService.start();
}
Also used : JerseyRestService(org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService) JettyConfiguration(org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration) TypeManager(org.eclipse.dataspaceconnector.spi.types.TypeManager) PortMapping(org.eclipse.dataspaceconnector.extension.jetty.PortMapping) CorsFilterConfiguration(org.eclipse.dataspaceconnector.extension.jersey.CorsFilterConfiguration) JettyService(org.eclipse.dataspaceconnector.extension.jetty.JettyService) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 3 with JettyConfiguration

use of org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration in project DataSpaceConnector by eclipse-dataspaceconnector.

the class ContractAgreementApiControllerIntegrationTest method prepareWebserver.

@BeforeAll
static void prepareWebserver() {
    port = TestUtils.getFreePort();
    var monitor = mock(Monitor.class);
    var config = new JettyConfiguration(null, null);
    config.portMapping(new PortMapping("data", port, "/api/v1/data"));
    var jetty = new JettyService(config, monitor);
    var ctrl = new ContractAgreementApiController(monitor);
    var jerseyService = new JerseyRestService(jetty, new TypeManager(), mock(CorsFilterConfiguration.class), monitor);
    jetty.start();
    jerseyService.registerResource("data", ctrl);
    jerseyService.start();
}
Also used : JerseyRestService(org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService) JettyConfiguration(org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration) TypeManager(org.eclipse.dataspaceconnector.spi.types.TypeManager) PortMapping(org.eclipse.dataspaceconnector.extension.jetty.PortMapping) CorsFilterConfiguration(org.eclipse.dataspaceconnector.extension.jersey.CorsFilterConfiguration) JettyService(org.eclipse.dataspaceconnector.extension.jetty.JettyService) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 4 with JettyConfiguration

use of org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration in project DataSpaceConnector by eclipse-dataspaceconnector.

the class ContractNegotiationApiControllerIntegrationTest method prepareWebserver.

@BeforeAll
static void prepareWebserver() {
    port = TestUtils.getFreePort();
    var monitor = mock(Monitor.class);
    var config = new JettyConfiguration(null, null);
    config.portMapping(new PortMapping("data", port, "/api/v1/data"));
    var jetty = new JettyService(config, monitor);
    var controller = new ContractNegotiationController(monitor);
    var jerseyService = new JerseyRestService(jetty, new TypeManager(), mock(CorsFilterConfiguration.class), monitor);
    jetty.start();
    jerseyService.registerResource("data", controller);
    jerseyService.start();
}
Also used : JerseyRestService(org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService) JettyConfiguration(org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration) TypeManager(org.eclipse.dataspaceconnector.spi.types.TypeManager) PortMapping(org.eclipse.dataspaceconnector.extension.jetty.PortMapping) CorsFilterConfiguration(org.eclipse.dataspaceconnector.extension.jersey.CorsFilterConfiguration) JettyService(org.eclipse.dataspaceconnector.extension.jetty.JettyService) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 5 with JettyConfiguration

use of org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration in project DataSpaceConnector by eclipse-dataspaceconnector.

the class JerseyRestServiceTest method startJetty.

private void startJetty(PortMapping... mapping) {
    JettyConfiguration config = new JettyConfiguration(null, null);
    Arrays.stream(mapping).forEach(config::portMapping);
    jettyService = new JettyService(config, monitorMock);
    jerseyRestService = new JerseyRestService(jettyService, new TypeManager(), CorsFilterConfiguration.none(), monitorMock);
    jettyService.start();
}
Also used : JettyConfiguration(org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration) TypeManager(org.eclipse.dataspaceconnector.spi.types.TypeManager) JettyService(org.eclipse.dataspaceconnector.extension.jetty.JettyService)

Aggregations

JettyConfiguration (org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration)9 PortMapping (org.eclipse.dataspaceconnector.extension.jetty.PortMapping)8 TypeManager (org.eclipse.dataspaceconnector.spi.types.TypeManager)8 BeforeAll (org.junit.jupiter.api.BeforeAll)8 JettyService (org.eclipse.dataspaceconnector.extension.jetty.JettyService)7 CorsFilterConfiguration (org.eclipse.dataspaceconnector.extension.jersey.CorsFilterConfiguration)6 JerseyRestService (org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService)6 ConsoleMonitor (org.eclipse.dataspaceconnector.spi.monitor.ConsoleMonitor)1 Monitor (org.eclipse.dataspaceconnector.spi.monitor.Monitor)1