View Javadoc

1   package it.com.atlassian.plugins.rest.sample.helloworld;
2   
3   import com.atlassian.plugins.rest.sample.helloworld.HelloWorld;
4   import com.atlassian.plugins.rest.sample.helloworld.UriBuilder;
5   import com.sun.jersey.api.client.Client;
6   
7   import static org.junit.Assert.assertEquals;
8   
9   import org.junit.Test;
10  
11  import java.net.URI;
12  
13  /**
14   * Testing {@link HelloWorld}
15   */
16  public class HelloWorldTest {
17      @Test
18      public void testGetHelloWorld() {
19          final URI baseUri = UriBuilder.create().path("rest").path("hw").path("1").build();
20          final String hello = Client.create().resource(baseUri).path("hello").path("world").get(String.class);
21          assertEquals("Hello world", hello);
22      }
23  }