use of io.dropwizard.client.JerseyClientBuilder in project dropwizard by dropwizard.
the class DropwizardSSLConnectionSocketFactoryTest method shouldRejectNonSupportedProtocols.
@Test
public void shouldRejectNonSupportedProtocols() throws Exception {
tlsConfiguration.setSupportedProtocols(Collections.singletonList("TLSv1.2"));
final Client client = new JerseyClientBuilder(TLS_APP_RULE.getEnvironment()).using(jerseyClientConfiguration).build("reject_non_supported");
assertThatThrownBy(() -> client.target(String.format("https://localhost:%d", TLS_APP_RULE.getPort(4))).request().get()).isInstanceOf(ProcessingException.class).hasRootCauseInstanceOf(SSLException.class);
}
use of io.dropwizard.client.JerseyClientBuilder in project textdb by TextDB.
the class QueryPlanResourceTest method checkSampleEndpoint.
/**
* Tests the query plan execution endpoint.
*/
@Test
public void checkSampleEndpoint() throws Exception {
Client client = new JerseyClientBuilder(RULE.getEnvironment()).build("test client");
client.property(ClientProperties.CONNECT_TIMEOUT, 5000);
client.property(ClientProperties.READ_TIMEOUT, 5000);
Response response = client.target(String.format(queryPlanEndpoint, RULE.getLocalPort())).request().post(Entity.entity(new ObjectMapper().writeValueAsString(getLogicalPlan1()), MediaType.APPLICATION_JSON));
assertThat(response.getStatus()).isEqualTo(200);
}
use of io.dropwizard.client.JerseyClientBuilder in project textdb by TextDB.
the class SystemResourceTest method getDictionaryPath.
// TODO: Figure out how to upload a dictionary in test case
@Test
@Ignore
public void getDictionaryPath() throws Exception {
Client client = new JerseyClientBuilder(RULE.getEnvironment()).build("test client");
client.property(ClientProperties.CONNECT_TIMEOUT, 5000);
client.property(ClientProperties.READ_TIMEOUT, 5000);
client.register(MultiPartFeature.class);
Response response = client.target(String.format("http://localhost:%d/api/resources/dictionary/?name=dictname", RULE.getLocalPort())).request().get();
assertThat(response.getStatus()).isEqualTo(200);
}
use of io.dropwizard.client.JerseyClientBuilder in project verify-hub by alphagov.
the class HubMetadataIntegrationTests method setUp.
@BeforeClass
public static void setUp() throws Exception {
JerseyClientConfiguration jerseyClientConfiguration = new JerseyClientConfiguration();
jerseyClientConfiguration.setConnectionTimeout(Duration.seconds(10));
jerseyClientConfiguration.setTimeout(Duration.seconds(10));
client = new JerseyClientBuilder(samlProxyAppRule.getEnvironment()).using(jerseyClientConfiguration).build(HubMetadataIntegrationTests.class.getName());
DateTimeFreezer.freezeTime();
}
use of io.dropwizard.client.JerseyClientBuilder in project verify-hub by alphagov.
the class DenialOfServiceAttacksIntegrationTests 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());
}
Aggregations