List of usage examples for org.springframework.mock.http.client MockClientHttpRequest setMethod
public void setMethod(HttpMethod httpMethod)
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); 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();//ww w .j av a 2 s. c o m this.interceptor.intercept(request, new byte[0], execution); }