package org.jboss.resteasy.test.resource.proxy;
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
import org.jboss.resteasy.client.core.executors.InMemoryClientExecutor;
import org.junit.Test;
import static junit.framework.Assert.*;
public class ProxiedSubresourceTest
{
/**
* This method tests RESTEASY-356
*/
@Test
public void testProxiedSubresource() throws Exception
{
InMemoryClientExecutor executor = new InMemoryClientExecutor();
executor.getRegistry().addPerRequestResource(Garage.class);
ClientResponse<String> result = new ClientRequest("/garage/car", executor).get(String.class);
assertEquals(200, result.getStatus());
assertEquals("MT-123AB", result.getEntity());
}
}