View Javadoc

1   package it.com.atlassian.rest.interceptor;
2   
3   import com.atlassian.plugins.rest.autowiring.SomeService;
4   import com.atlassian.plugins.rest.interceptor.Message;
5   import com.atlassian.rest.jersey.client.WebResourceFactory;
6   import com.sun.jersey.api.client.WebResource;
7   import org.junit.Before;
8   import org.junit.Test;
9   
10  import static org.junit.Assert.assertEquals;
11  
12  public class InterceptedResourceTest
13  {
14      private WebResource webResource;
15  
16      @Before
17      public void setUp()
18      {
19          webResource = WebResourceFactory.authenticated();
20      }
21  
22      @Test
23      public void testGetAutowiredResource()
24      {
25          final Message message = webResource.path("interceptedResource").get(Message.class);
26  
27          assertEquals("Hello World: Bob", message.getMessage());
28      }
29  }