Search in sources :

Example 1 with JerseyRestService

use of org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService 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 JerseyRestService

use of org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService 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 JerseyRestService

use of org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService 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 JerseyRestService

use of org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService 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 JerseyRestService

use of org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService in project DataSpaceConnector by eclipse-dataspaceconnector.

the class RemoteDataPlaneSelectorClientTest method startRestApi.

private JettyService startRestApi() {
    // set REST API
    serviceMock = mock(DataPlaneSelectorService.class);
    var controller = new DataplaneSelectorApiController(serviceMock);
    var jetty = new JettyService(config, monitor);
    var jerseyService = new JerseyRestService(jetty, typeManager, mock(CorsFilterConfiguration.class), monitor);
    jetty.start();
    jerseyService.registerResource("dataplane", controller);
    jerseyService.registerResource("dataplane", new EdcApiExceptionMapper());
    jerseyService.start();
    return jetty;
}
Also used : JerseyRestService(org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService) EdcApiExceptionMapper(org.eclipse.dataspaceconnector.api.exception.mappers.EdcApiExceptionMapper) DataPlaneSelectorService(org.eclipse.dataspaceconnector.dataplane.selector.DataPlaneSelectorService) CorsFilterConfiguration(org.eclipse.dataspaceconnector.extension.jersey.CorsFilterConfiguration) DataplaneSelectorApiController(org.eclipse.dataspaceconnector.dataplane.selector.api.DataplaneSelectorApiController) JettyService(org.eclipse.dataspaceconnector.extension.jetty.JettyService)

Aggregations

CorsFilterConfiguration (org.eclipse.dataspaceconnector.extension.jersey.CorsFilterConfiguration)8 JerseyRestService (org.eclipse.dataspaceconnector.extension.jersey.JerseyRestService)8 JettyService (org.eclipse.dataspaceconnector.extension.jetty.JettyService)8 TypeManager (org.eclipse.dataspaceconnector.spi.types.TypeManager)7 JettyConfiguration (org.eclipse.dataspaceconnector.extension.jetty.JettyConfiguration)6 PortMapping (org.eclipse.dataspaceconnector.extension.jetty.PortMapping)6 BeforeAll (org.junit.jupiter.api.BeforeAll)6 EdcApiExceptionMapper (org.eclipse.dataspaceconnector.api.exception.mappers.EdcApiExceptionMapper)2 DataPlaneSelectorService (org.eclipse.dataspaceconnector.dataplane.selector.DataPlaneSelectorService)1 DataPlaneSelectorServiceImpl (org.eclipse.dataspaceconnector.dataplane.selector.DataPlaneSelectorServiceImpl)1 DataplaneSelectorApiController (org.eclipse.dataspaceconnector.dataplane.selector.api.DataplaneSelectorApiController)1 DataPlaneSelectorImpl (org.eclipse.dataspaceconnector.dataplane.selector.core.DataPlaneSelectorImpl)1 DefaultDataPlaneInstanceStore (org.eclipse.dataspaceconnector.dataplane.selector.store.DefaultDataPlaneInstanceStore)1 DefaultSelectionStrategyRegistry (org.eclipse.dataspaceconnector.dataplane.selector.strategy.DefaultSelectionStrategyRegistry)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1