Search in sources :

Example 6 with TestSuiteGlobalConf

use of ee.ria.xroad.proxy.testsuite.TestSuiteGlobalConf in project X-Road by nordic-institute.

the class SslSelectFastestProxy method startUp.

@Override
protected void startUp() throws Exception {
    super.startUp();
    GlobalConf.reload(new TestSuiteGlobalConf() {

        @Override
        public Collection<String> getProviderAddress(ClientId provider) {
            return Arrays.asList("127.0.0.5", "localhost", "server.invalid.", "127.0.0,1");
        }
    });
}
Also used : TestSuiteGlobalConf(ee.ria.xroad.proxy.testsuite.TestSuiteGlobalConf) ClientId(ee.ria.xroad.common.identifier.ClientId) Collection(java.util.Collection)

Example 7 with TestSuiteGlobalConf

use of ee.ria.xroad.proxy.testsuite.TestSuiteGlobalConf in project X-Road by nordic-institute.

the class SslAuthTrustManagerError method startUp.

@Override
protected void startUp() throws Exception {
    ServerConf.reload(new TestSuiteServerConf());
    GlobalConf.reload(new TestSuiteGlobalConf() {

        @Override
        public SecurityServerId getServerId(X509Certificate cert) {
            return null;
        }
    });
}
Also used : TestSuiteGlobalConf(ee.ria.xroad.proxy.testsuite.TestSuiteGlobalConf) TestSuiteServerConf(ee.ria.xroad.proxy.testsuite.TestSuiteServerConf) SecurityServerId(ee.ria.xroad.common.identifier.SecurityServerId) X509Certificate(java.security.cert.X509Certificate)

Example 8 with TestSuiteGlobalConf

use of ee.ria.xroad.proxy.testsuite.TestSuiteGlobalConf in project X-Road by nordic-institute.

the class MetadataServiceHandlerTest method init.

/**
 * Init data for tests
 */
@Before
public void init() throws IOException {
    GlobalConf.reload(new TestSuiteGlobalConf());
    KeyConf.reload(new TestSuiteKeyConf());
    ServerConf.reload(new TestSuiteServerConf());
    httpClientMock = mock(HttpClient.class);
    mockRequest = mock(HttpServletRequest.class);
    mockResponse = mock(HttpServletResponse.class);
    mockServletOutputStream = new MetaserviceTestUtil.StubServletOutputStream();
    when(mockResponse.getOutputStream()).thenReturn(mockServletOutputStream);
    mockProxyMessage = mock(ProxyMessage.class);
    when(mockProxyMessage.getSoapContentType()).thenReturn(MimeTypes.TEXT_XML_UTF8);
    this.mockServer = new WireMockServer(options().port(WSDL_SERVER_PORT));
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) ProxyMessage(ee.ria.xroad.proxy.protocol.ProxyMessage) TestSuiteGlobalConf(ee.ria.xroad.proxy.testsuite.TestSuiteGlobalConf) TestSuiteKeyConf(ee.ria.xroad.proxy.testsuite.TestSuiteKeyConf) TestSuiteServerConf(ee.ria.xroad.proxy.testsuite.TestSuiteServerConf) HttpClient(org.apache.http.client.HttpClient) HttpServletResponse(javax.servlet.http.HttpServletResponse) WireMockServer(com.github.tomakehurst.wiremock.WireMockServer) MetaserviceTestUtil(ee.ria.xroad.proxy.util.MetaserviceTestUtil) Before(org.junit.Before)

Example 9 with TestSuiteGlobalConf

use of ee.ria.xroad.proxy.testsuite.TestSuiteGlobalConf in project X-Road by nordic-institute.

the class ProxyMonitorServiceHandlerMetricsTest method init.

/**
 * Init data for tests
 */
@Before
public void init() throws IOException {
    GlobalConf.reload(new TestSuiteGlobalConf() {

        @Override
        public String getInstanceIdentifier() {
            return EXPECTED_XR_INSTANCE;
        }
    });
    KeyConf.reload(new TestSuiteKeyConf());
    ServerConf.reload(new TestSuiteServerConf() {

        @Override
        public SecurityServerId getIdentifier() {
            return DEFAULT_OWNER_SERVER;
        }
    });
    mockRequest = mock(HttpServletRequest.class);
    mockProxyMessage = mock(ProxyMessage.class);
    when(mockProxyMessage.getSoapContentType()).thenReturn(MimeTypes.TEXT_XML_UTF8);
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) ProxyMessage(ee.ria.xroad.proxy.protocol.ProxyMessage) TestSuiteGlobalConf(ee.ria.xroad.proxy.testsuite.TestSuiteGlobalConf) TestSuiteKeyConf(ee.ria.xroad.proxy.testsuite.TestSuiteKeyConf) TestSuiteServerConf(ee.ria.xroad.proxy.testsuite.TestSuiteServerConf) SecurityServerId(ee.ria.xroad.common.identifier.SecurityServerId) Before(org.junit.Before)

Example 10 with TestSuiteGlobalConf

use of ee.ria.xroad.proxy.testsuite.TestSuiteGlobalConf in project X-Road by nordic-institute.

the class SecurityServerMetricsMessage method startUp.

@Override
protected void startUp() throws Exception {
    super.startUp();
    GlobalConf.reload(new TestSuiteGlobalConf() {

        @Override
        public String getInstanceIdentifier() {
            return EXPECTED_XR_INSTANCE;
        }
    });
    KeyConf.reload(new TestSuiteKeyConf());
    ServerConf.reload(new TestSuiteServerConf() {

        @Override
        public SecurityServerId getIdentifier() {
            return DEFAULT_OWNER_SERVER;
        }
    });
    unmarshaller = JAXBContext.newInstance(GetSecurityServerMetricsResponse.class).createUnmarshaller();
    ACTOR_SYSTEM.actorOf(Props.create(MockMetricsProvider.class), "MetricsProviderActor");
}
Also used : TestSuiteGlobalConf(ee.ria.xroad.proxy.testsuite.TestSuiteGlobalConf) TestSuiteKeyConf(ee.ria.xroad.proxy.testsuite.TestSuiteKeyConf) TestSuiteServerConf(ee.ria.xroad.proxy.testsuite.TestSuiteServerConf) SecurityServerId(ee.ria.xroad.common.identifier.SecurityServerId)

Aggregations

TestSuiteGlobalConf (ee.ria.xroad.proxy.testsuite.TestSuiteGlobalConf)17 TestSuiteKeyConf (ee.ria.xroad.proxy.testsuite.TestSuiteKeyConf)8 TestSuiteServerConf (ee.ria.xroad.proxy.testsuite.TestSuiteServerConf)8 HttpServletRequest (javax.servlet.http.HttpServletRequest)7 Before (org.junit.Before)7 ClientId (ee.ria.xroad.common.identifier.ClientId)5 List (java.util.List)5 HttpServletResponse (javax.servlet.http.HttpServletResponse)5 SecurityServerId (ee.ria.xroad.common.identifier.SecurityServerId)4 ProxyMessage (ee.ria.xroad.proxy.protocol.ProxyMessage)4 MetaserviceTestUtil (ee.ria.xroad.proxy.util.MetaserviceTestUtil)3 X509Certificate (java.security.cert.X509Certificate)3 HttpClient (org.apache.http.client.HttpClient)3 WireMockServer (com.github.tomakehurst.wiremock.WireMockServer)2 MemberInfo (ee.ria.xroad.common.conf.globalconf.MemberInfo)2 CentralServiceId (ee.ria.xroad.common.identifier.CentralServiceId)2 Collection (java.util.Collection)2 Test (org.junit.Test)2 GlobalConf (ee.ria.xroad.common.conf.globalconf.GlobalConf)1 DescriptionType (ee.ria.xroad.common.conf.serverconf.model.DescriptionType)1