Search in sources :

Example 66 with JerseyClientBuilder

use of io.dropwizard.client.JerseyClientBuilder in project verify-hub by alphagov.

the class MatchingServiceHealthCheckIntegrationTests method setUp.

@BeforeClass
public static void setUp() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlSoapProxyAppRule.getEnvironment()).using(jerseyClientConfiguration).build(MatchingServiceHealthCheckIntegrationTests.class.getSimpleName());
    eventSinkStub.setupStubForLogging();
    configStub.setupStubForCertificates(msaEntityId, TEST_RP_MS_PUBLIC_SIGNING_CERT, TEST_RP_MS_PUBLIC_ENCRYPTION_CERT);
    configStub.setupStubForCertificates(msaEntityId2, TEST_RP_MS_PUBLIC_SIGNING_CERT, TEST_RP_MS_PUBLIC_ENCRYPTION_CERT);
}
Also used : JerseyClientConfiguration(io.dropwizard.client.JerseyClientConfiguration) JerseyClientBuilder(io.dropwizard.client.JerseyClientBuilder) BeforeClass(org.junit.BeforeClass)

Example 67 with JerseyClientBuilder

use of io.dropwizard.client.JerseyClientBuilder in project verify-hub by alphagov.

the class MatchingServiceRequestSenderTest method setUpClass.

@BeforeClass
public static void setUpClass() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlSoapProxyAppRule.getEnvironment()).using(jerseyClientConfiguration).build(MatchingServiceRequestSenderTest.class.getSimpleName());
    eventSinkStubRule.setupStubForLogging();
    configStub.setupStubForCertificates(TEST_RP_MS);
    String soap = createMsaResponse();
    final String attibute_query_resource = "/attribute-query-request";
    RequestAndResponse requestAndResponse = ExpectedRequestBuilder.expectRequest().withPath(attibute_query_resource).andWillRespondWith().withStatus(200).withBody(soap).withContentType(MediaType.TEXT_XML_TYPE.toString()).build();
    msaStubRule.register(requestAndResponse);
}
Also used : JerseyClientConfiguration(io.dropwizard.client.JerseyClientConfiguration) RequestAndResponse(httpstub.RequestAndResponse) JerseyClientBuilder(io.dropwizard.client.JerseyClientBuilder) BeforeClass(org.junit.BeforeClass)

Aggregations

JerseyClientBuilder (io.dropwizard.client.JerseyClientBuilder)67 JerseyClientConfiguration (io.dropwizard.client.JerseyClientConfiguration)46 BeforeClass (org.junit.BeforeClass)45 Client (javax.ws.rs.client.Client)21 Test (org.junit.Test)21 Response (javax.ws.rs.core.Response)14 ClientResponse (org.glassfish.jersey.client.ClientResponse)7 File (java.io.File)4 ProcessingException (javax.ws.rs.ProcessingException)3 Assertions.catchThrowable (org.assertj.core.api.Assertions.catchThrowable)3 MultiPart (org.glassfish.jersey.media.multipart.MultiPart)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 FormDataBodyPart (org.glassfish.jersey.media.multipart.FormDataBodyPart)2 FormDataMultiPart (org.glassfish.jersey.media.multipart.FormDataMultiPart)2 Ignore (org.junit.Ignore)2 RequestAndResponse (httpstub.RequestAndResponse)1 ErrorMessage (io.dropwizard.jersey.errors.ErrorMessage)1 NoopHostnameVerifier (org.apache.http.conn.ssl.NoopHostnameVerifier)1 FileDataBodyPart (org.glassfish.jersey.media.multipart.file.FileDataBodyPart)1 Before (org.junit.Before)1