View Javadoc

1   package it.com.atlassian.rest.expand;
2   
3   import com.atlassian.plugins.rest.expand.Expand;
4   import com.atlassian.rest.jersey.client.WebResourceFactory;
5   import com.google.common.collect.Lists;
6   import com.sun.jersey.api.client.WebResource;
7   import org.junit.Before;
8   import org.junit.Test;
9   
10  import static junit.framework.Assert.assertTrue;
11  
12  /**
13   * Test for expand functionality.
14   */
15  public class ExpandTest {
16      private WebResource webResource;
17  
18      @Before
19      public void setUp() {
20          webResource = WebResourceFactory.authenticated();
21      }
22  
23      @Test
24      public void selfExpandingFieldGetsExpanded() {
25          Expand expand = webResource.path("expand").queryParam("expand", "selfExpanding").get(Expand.class);
26  
27          assertTrue(Lists.<Object>newArrayList(Expand.SELF_EXPANDING_STRINGS).equals(expand.getSelfExpanding()));
28      }
29  }