Advertisement
ManZzup

Untitled

Aug 12th, 2016
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1.     private final static String ENDPOINT_ADDRESS = "https://localhost:5000/rest";
  2.     private final static String WADL_ADDRESS = ENDPOINT_ADDRESS + "?_wadl";
  3.  
  4.     private static void waitForWADL() throws Exception {
  5.         WebClient client = WebClient.create(WADL_ADDRESS);
  6.         // wait for 20 secs or so
  7.         for (int i = 0; i < 20; i++) {
  8.             Thread.currentThread().sleep(1000);
  9.             Response response = client.get();
  10.             if (response.getStatus() == 200) {
  11.                 break;
  12.             }
  13.         }
  14.         // no WADL is available yet - throw an exception or give tests a chance to run anyway
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement