Package org.jboss.resteasy.test.resource.proxy

Source Code of org.jboss.resteasy.test.resource.proxy.ProxiedSubresourceTest

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());
   }
}
TOP

Related Classes of org.jboss.resteasy.test.resource.proxy.ProxiedSubresourceTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.