List of usage examples for org.springframework.mock.http.client MockClientHttpRequest setURI
public void setURI(URI uri)
From source file:com.gopivotal.cla.github.RateLimitingClientHttpRequestInterceptorTest.java
@Test public void block() throws InterruptedException, IOException { CountDownLatch latch = new CountDownLatch(1); MockClientHttpRequest request = new MockClientHttpRequest(); MockClientHttpResponse response = new MockClientHttpResponse(new byte[0], HttpStatus.OK); ClientHttpRequestExecution execution = mock(ClientHttpRequestExecution.class); request.setMethod(HttpMethod.GET);/*from www. ja va 2 s . c o m*/ request.setURI(URI.create("http://localhost")); when(execution.execute(request, new byte[0])).thenReturn(response); new Thread(new Trigger(this.interceptor, latch)).start(); latch.await(); this.interceptor.intercept(request, new byte[0], execution); }