Skip to content

Commit

Permalink
Improve/fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
asoldano committed Nov 20, 2017
1 parent a327907 commit 31fcd91
Showing 1 changed file with 31 additions and 2 deletions.
Expand Up @@ -69,7 +69,7 @@ public static WebArchive createDeployments() {
@RunAsClient
public void testQueryCustomers() throws Exception
{
URI uri = new URI(baseURL + "services/customers");
URI uri = new URI(baseURL + "services/customers?start=0&size=5");
Client client = ClientBuilder.newClient();
StringBuilder sb = new StringBuilder();
try {
Expand All @@ -88,7 +88,36 @@ public void testQueryCustomers() throws Exception
Assert.assertTrue(s.contains("Monica"));
Assert.assertTrue(s.contains("Steve"));
Assert.assertTrue(s.contains("Rod"));
Assert.assertTrue(s.contains("Bob"));
Assert.assertFalse(s.contains("Bob"));
} finally {
client.close();
}
}

@Test
@RunAsClient
public void testQueryCustomers2() throws Exception
{
URI uri = new URI(baseURL + "services/customers");
Client client = ClientBuilder.newClient();
StringBuilder sb = new StringBuilder();
try {
while (uri != null)
{
WebTarget target = client.target(uri);
String output = target.request().get(String.class);
sb.append(output);

Customers customers = target.request().get(Customers.class);
uri = customers.getNext();
}
String s = sb.toString();
Assert.assertTrue(s.contains("Bill"));
Assert.assertTrue(s.contains("Joe"));
Assert.assertFalse(s.contains("Monica"));
Assert.assertFalse(s.contains("Steve"));
Assert.assertFalse(s.contains("Rod"));
Assert.assertFalse(s.contains("Bob"));
} finally {
client.close();
}
Expand Down

0 comments on commit 31fcd91

Please sign in to comment.