Running following Unit Test:
*********************************************************************************
TestClass RestEasyTestJava.java:
-----------------------------------------------------------------------------------------------
package com.commend.module;
import com.commend.platform.junit.WeldTest;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.junit.Test;
import java.net.URI;
import java.net.URISyntaxException;
public class RestEasyTestJava extends WeldTest {
@Test
public void clientTest() {
try
{
final URI uri = new URI("http://[::1]:8080");
final ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();
final MyServiceJava proxy = clientBuilder.build().target(uri).proxy(MyServiceJava.class);
proxy.get(2);
}
catch (final URISyntaxException e)
{
e.printStackTrace();
}
}
}
-----------------------------------------------------------------------------------------------
*********************************************************************************
Interface MyServiceJava.java
-----------------------------------------------------------------------------------------------
package com.commend.module;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@Path("/myservice")
interface MyServiceJava {
@GET
@Path("/
{id}
")
@Consumes("text/json")
void get(@PathParam("id") int id);
}
-----------------------------------------------------------------------------------------------