Package org.jboss.resteasy.spi.touri

Examples of org.jboss.resteasy.spi.touri.ObjectToURI.resolveURI()


   {
      ObjectToURI instance = ObjectToURI.getInstance();
      Assert.assertEquals("/foo/123", instance
              .resolveURI(new URITemplateObject(123)));
      Assert.assertEquals("/my-url", instance.resolveURI(new URIableObject()));
      Assert.assertEquals("/foo/123", instance.resolveURI(new MappedByObject(
              123)));
   }

   @Test
   public void testCustomResolver()
View Full Code Here


   @Test
   public void testCustomResolver()
   {
      ObjectToURI instance = ObjectToURI.getInstance();
      CustomURIableObject custom = new CustomURIableObject();
      Assert.assertEquals("/my-url", instance.resolveURI(custom));

      instance.registerURIResolver(new URIResolver()
      {
         public boolean handles(Class<?> type)
         {
View Full Code Here

         {
            return "/some-other-uri";
         }
      });

      Assert.assertEquals("/some-other-uri", instance.resolveURI(custom));
   }
}
View Full Code Here

   @Test
   public void testDefaultResolvers()
   {
      ObjectToURI instance = ObjectToURI.getInstance();
      Assert.assertEquals("/foo/123", instance
              .resolveURI(new URITemplateObject(123)));
      Assert.assertEquals("/my-url", instance.resolveURI(new URIableObject()));
      Assert.assertEquals("/foo/123", instance.resolveURI(new MappedByObject(
              123)));
   }
View Full Code Here

   public void testDefaultResolvers()
   {
      ObjectToURI instance = ObjectToURI.getInstance();
      Assert.assertEquals("/foo/123", instance
              .resolveURI(new URITemplateObject(123)));
      Assert.assertEquals("/my-url", instance.resolveURI(new URIableObject()));
      Assert.assertEquals("/foo/123", instance.resolveURI(new MappedByObject(
              123)));
   }

   @Test
View Full Code Here

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.