Created
June 24, 2012 03:20
-
-
Save ajaykumarns/2981345 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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