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);
}
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);
}
Aggregations