Search in sources :

Example 21 with JerseyClientBuilder

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

the class MetadataConsumerTests method setUpClient.

@BeforeClass
public static void setUpClient() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlProxyAppRule.getEnvironment()).using(jerseyClientConfiguration).build(SamlMessageReceiverApiResourceTest.class.getSimpleName());
}
Also used : JerseyClientConfiguration(io.dropwizard.client.JerseyClientConfiguration) JerseyClientBuilder(io.dropwizard.client.JerseyClientBuilder) BeforeClass(org.junit.BeforeClass)

Example 22 with JerseyClientBuilder

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

the class ResourceNotFound404IntegrationTests method setUpClass.

@BeforeClass
public static void setUpClass() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlProxyAppRule.getEnvironment()).using(jerseyClientConfiguration).build(SamlMessageReceiverApiResourceTest.class.getSimpleName());
}
Also used : JerseyClientConfiguration(io.dropwizard.client.JerseyClientConfiguration) JerseyClientBuilder(io.dropwizard.client.JerseyClientBuilder) BeforeClass(org.junit.BeforeClass)

Example 23 with JerseyClientBuilder

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

the class SamlMessageReceiverApiResourceEidasEnabledTest method setUpClient.

@BeforeClass
public static void setUpClient() throws Exception {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(samlProxyAppRule.getEnvironment()).using(jerseyClientConfiguration).build(SamlMessageReceiverApiResourceEidasEnabledTest.class.getSimpleName());
    eventSinkStubRule.register(Urls.HubSupportUrls.HUB_SUPPORT_EVENT_SINK_RESOURCE, Response.Status.OK.getStatusCode());
}
Also used : JerseyClientConfiguration(io.dropwizard.client.JerseyClientConfiguration) JerseyClientBuilder(io.dropwizard.client.JerseyClientBuilder) BeforeClass(org.junit.BeforeClass)

Example 24 with JerseyClientBuilder

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

the class EidasSessionResourceContractTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    IdaSamlBootstrap.bootstrap();
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(policy.getEnvironment()).using(jerseyClientConfiguration).build(EidasSessionResourceContractTest.class.getSimpleName());
    sessionId = SessionId.createNewSessionId();
    samlAuthnResponseContainerDto = createAuthnResponseSignedByKeyPair(sessionId, TestCertificateStrings.STUB_IDP_PUBLIC_PRIMARY_CERT, TestCertificateStrings.STUB_IDP_PUBLIC_PRIMARY_PRIVATE_KEY);
    encryptedIdentityAssertion = AssertionBuilder.anAssertion().withId(UUID.randomUUID().toString()).build();
    encryptedIdentityAssertionString = XML_OBJECT_XML_OBJECT_TO_BASE_64_ENCODED_STRING_TRANSFORMER.apply(encryptedIdentityAssertion);
}
Also used : JerseyClientConfiguration(io.dropwizard.client.JerseyClientConfiguration) JerseyClientBuilder(io.dropwizard.client.JerseyClientBuilder) BeforeClass(org.junit.BeforeClass)

Example 25 with JerseyClientBuilder

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

the class Cycle3DataResourceTest method beforeClass.

@BeforeClass
public static void beforeClass() {
    JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
    client = new JerseyClientBuilder(policy.getEnvironment()).using(jerseyClientConfiguration).build(Cycle3DataResourceTest.class.getSimpleName());
}
Also used : JerseyClientConfiguration(io.dropwizard.client.JerseyClientConfiguration) 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