File tree Expand file tree Collapse file tree
jaxrs/async-server/src/test/java/org/javaee7/jaxrs/asyncserver Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ * To change this license header, choose License Headers in Project Properties.
3+ * To change this template file, choose Tools | Templates
4+ * and open the template in the editor.
5+ */
6+
7+ package org .javaee7 .jaxrs .asyncserver ;
8+
9+ import javax .ws .rs .client .Client ;
10+ import javax .ws .rs .client .ClientBuilder ;
11+ import javax .ws .rs .client .WebTarget ;
12+ import org .junit .BeforeClass ;
13+ import org .junit .Test ;
14+ import static org .junit .Assert .*;
15+
16+ /**
17+ * @author Arun Gupta
18+ */
19+ public class MyResourceTest {
20+ private static WebTarget target ;
21+
22+ public MyResourceTest () {
23+ }
24+
25+ @ BeforeClass
26+ public static void setUpClass () {
27+ Client client = ClientBuilder .newClient ();
28+ target = client .target ("http://localhost:8080/async-server/webresources/fruits" );
29+ }
30+
31+ /**
32+ * Test of getList method, of class MyResource.
33+ */
34+ @ Test
35+ public void testGetList () {
36+ String result = target .request ().get (String .class );
37+ assertEquals ("apple" , result );
38+ }
39+
40+ }
You can’t perform that action at this time.
0 commit comments