Skip to content

Instantly share code, notes, and snippets.

@ajaykumarns
Created June 24, 2012 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajaykumarns/2981345 to your computer and use it in GitHub Desktop.
Save ajaykumarns/2981345 to your computer and use it in GitHub Desktop.
public class ProxiedProductClient{
public static void main(String[] args) {
RestTemplate template = new RestTemplate();
ProductClient productClient = RestClientProxy.createProxy("http://localhost:8080/test-server/", template, ProductClient.class);
//System.out.println(productClient.withId(123));
Random rand = new Random();
for (int i = 0; i < 10; ++i) {
Product p = new Product();
p.setName("apple");
p.setPrice(rand.nextFloat());
p.setQuantity(Math.abs(rand.nextInt()));
p = productClient.createProduct(p);
System.out.println(p);
}
System.out.println(productClient.queryProducts(.75f, .9f, 99999999l));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment