use of org.glassfish.jersey.client.JerseyClientBuilder in project athenz by yahoo.
the class MSDClientTimeoutTest method testMSDClientReadTimeoutForJerseyContainer.
@Test
public void testMSDClientReadTimeoutForJerseyContainer() throws Exception {
MSDClientMock.setClientBuilder(new JerseyClientBuilder());
server = new JettyServer(port);
server.start();
String baseUri = "http://localhost:" + port;
final SSLContext dummyContext = createDummySslContext();
MSDClientMock msdClient = new MSDClientMock(baseUri, dummyContext);
try {
msdClient.getTransportPolicyRules(null, null);
fail("read timeout not set");
} catch (MSDClientException expected) {
assertEquals(expected.code, ResourceException.BAD_REQUEST);
assertEquals(expected.getMessage(), "ResourceException (400): java.net.SocketTimeoutException: Read timed out");
}
msdClient.close();
MSDClientMock.setClientBuilder(null);
}
Aggregations