public class ClienteTest {
public static void main(String[] args) {
new ClienteTest();
}
public ClienteTest() {
testaQueAConexaoComOServidorFunciona();
}
@Test
public void testaQueAConexaoComOServidorFunciona() {
Client client = ClientBuilder.newClient();
WebTarget target = client.target("http://www.mocky.io");
String conteudo = target.path("/v2/52aaf5dee7ba8c70329fb7d").request().get(String.class);
Assert.assertTrue(conteudo.contains("<rua>Rua Vergueiro 3185"));
}
Estou tendo o erro:
Exception in thread "main" javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:929) at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:770) at org.glassfish.jersey.client.JerseyInvocation.access$500(JerseyInvocation.java:90) at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:671) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:228) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:422) at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:667) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:396) at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:296) at br.com.alura.loja.ClienteTest.testaQueAConexaoComOServidorFunciona(ClienteTest.java:27) at br.com.alura.loja.ClienteTest.(ClienteTest.java:21) at br.com.alura.loja.ClienteTest.main(ClienteTest.java:17)