Search in sources :

Example 1 with CrossDomainConfig

use of com.quorum.tessera.config.CrossDomainConfig in project tessera by ConsenSys.

the class CorsDomainResponseFilterTest method setUp.

@Before
public void setUp() {
    CrossDomainConfig crossDomainConfig = new CrossDomainConfig();
    crossDomainConfig.setAllowedOrigins(Arrays.asList(SOME_ORIGIN));
    domainResponseFilter = new CorsDomainResponseFilter(crossDomainConfig);
    requestContext = mock(ContainerRequestContext.class);
    responseContext = mock(ContainerResponseContext.class);
}
Also used : CrossDomainConfig(com.quorum.tessera.config.CrossDomainConfig) ContainerRequestContext(jakarta.ws.rs.container.ContainerRequestContext) ContainerResponseContext(jakarta.ws.rs.container.ContainerResponseContext) Before(org.junit.Before)

Example 2 with CrossDomainConfig

use of com.quorum.tessera.config.CrossDomainConfig in project tessera by ConsenSys.

the class JerseyServerIT method onSetUp.

@Before
public void onSetUp() throws Exception {
    System.setProperty("sun.net.http.allowRestrictedHeaders", "true");
    ServerConfig serverConfig = new ServerConfig();
    serverConfig.setCommunicationType(CommunicationType.REST);
    serverConfig.setServerAddress("http://localhost:8080");
    CrossDomainConfig crossDomainConfig = new CrossDomainConfig();
    crossDomainConfig.setAllowedOrigins(Arrays.asList("*.acme.com", "*.other.com"));
    serverConfig.setCrossDomainConfig(crossDomainConfig);
    JaxbUtil.marshalWithNoValidation(serverConfig, System.out);
    server = new JerseyServer(serverConfig, SampleApplication.class);
    server.start();
}
Also used : ServerConfig(com.quorum.tessera.config.ServerConfig) CrossDomainConfig(com.quorum.tessera.config.CrossDomainConfig) Before(org.junit.Before)

Aggregations

CrossDomainConfig (com.quorum.tessera.config.CrossDomainConfig)2 Before (org.junit.Before)2 ServerConfig (com.quorum.tessera.config.ServerConfig)1 ContainerRequestContext (jakarta.ws.rs.container.ContainerRequestContext)1 ContainerResponseContext (jakarta.ws.rs.container.ContainerResponseContext)1