package org.jboss.resteasy.test; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import junit.framework.Assert; import org.jboss.resteasy.client.ProxyFactory; import org.junit.Test; public class TestSuperclassInterfaceAnnotation extends BaseResourceTest { public static interface SuperInt { @Path("foo") @GET @Produces("application/json") String getFoo(); } public static abstract class SuperIntAbstract implements SuperInt { @Override public String getFoo() { return "Foo: " + getName(); } protected abstract String getName(); } @Path("/somewhere") public static class SomeOtherResource { @Path("superint") public SuperInt getSuperInt() { return new SuperIntAbstract() { @Override protected String getName() { return "Fred"; } }; } } @Test public void testSuperclassInterfaceAnnotation() { addPerRequestResource(SomeOtherResource.class); SuperInt proxy = ProxyFactory.create(SuperInt.class, TestPortProvider.generateURL("/somewhere/superint")); Assert.assertEquals("Foo: Fred", proxy.getFoo()); } }