Search in sources :

Example 1 with IncomingRequestAwareClient

use of com.spotify.apollo.environment.IncomingRequestAwareClient in project apollo by spotify.

the class FallbackClientTest method setUp.

@Before
public void setUp() throws Exception {
    final IncomingRequestAwareClient client = new FixedReplyClient("I am pretty rigid");
    stubClient = new StubClient();
    fallbackClient = new FallbackClient(stubClient.asRequestAwareClient(), client);
}
Also used : IncomingRequestAwareClient(com.spotify.apollo.environment.IncomingRequestAwareClient) Before(org.junit.Before)

Example 2 with IncomingRequestAwareClient

use of com.spotify.apollo.environment.IncomingRequestAwareClient in project apollo by spotify.

the class RequestHandlerImplTest method setUp.

@Before
public void setUp() throws Exception {
    IncomingRequestAwareClient client = new NoopClient();
    requestMetadata = RequestMetadataImpl.create(Instant.ofEpochSecond(4711L), Optional.empty(), Optional.empty());
    when(ongoingRequest.metadata()).thenReturn(requestMetadata);
    when(ongoingRequest.request()).thenReturn(Request.forUri("http://foo"));
    when(requestFactory.create(any())).thenReturn(requestRunnable);
    when(endpointFactory.create(eq(ongoingRequest), requestContextCaptor.capture(), eq(endpoint))).thenReturn(runnable);
    when(match.getRule()).thenReturn(Rule.fromUri("http://foo", "GET", endpoint));
    when(endpoint.info()).thenReturn(info);
    when(info.getName()).thenReturn("foo");
    requestHandler = new RequestHandlerImpl(requestFactory, endpointFactory, client);
}
Also used : IncomingRequestAwareClient(com.spotify.apollo.environment.IncomingRequestAwareClient) Before(org.junit.Before)

Aggregations

IncomingRequestAwareClient (com.spotify.apollo.environment.IncomingRequestAwareClient)2 Before (org.junit.Before)2