Skip to content

Commit cc5e2ab

Browse files
committed
Adding tests
1 parent 4386c91 commit cc5e2ab

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
}

0 commit comments

Comments
 (0)