//implementacao package br.com.alura.loja;
import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.WebTarget;
import org.junit.Assert; import org.junit.Test;
public class ClienteTest {
@Test public void testaQueAConexaoComOServidorFunciona() {
Client client = ClientBuilder.newClient(); WebTarget target = client.target("http://www.mocky.io");
String conteudo = target.path("/v2/52aaf5deee7ba8c70329fb7d").request().get(String.class);
Assert.assertTrue(conteudo.contains("Rua Vergueiro 3185")); } }
//erro Class not found br.com.alura.loja.ClienteTest java.lang.ClassNotFoundException: br.com.alura.loja.ClienteTest at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:685) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)