customer = client.target(uri).request().get(Customer.class);
}
System.out.println();
System.out.println("Search for iPhone in the Product database");
Products prods = client.target(products)
.queryParam("name", "iPhone")
.request()
.get(Products.class);
Product product = null;
if (prods.getProducts().size() > 0)
{
System.out.println("- Found iPhone in the database.");
product = prods.getProducts().iterator().next();
}
else
{
throw new RuntimeException("Failed to find an iPhone in the database!");
}