io.fabric8.mockwebserver.ServerRequest Java Examples

The following examples show how to use io.fabric8.mockwebserver.ServerRequest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MixedKubernetesServer.java    From flink with Apache License 2.0 5 votes vote down vote up
public void before() {
	HashMap<ServerRequest, Queue<ServerResponse>> response = new HashMap<>();
	mock = crudMode
		? new KubernetesMockServer(new Context(), new MockWebServer(), response, new MixedDispatcher(response), true)
		: new KubernetesMockServer(https);
	mock.init();
	client = mock.createClient();
}
 
Example #2
Source File: MockServerExpectationImpl.java    From mockwebserver with Apache License 2.0 5 votes vote down vote up
public MockServerExpectationImpl(Context context, HttpMethod method, String path, ResponseProvider<String> bodyProvider, ResponseProvider<List<String>> chunksProvider, long delay, TimeUnit delayUnit, int times, Map<ServerRequest, Queue<ServerResponse>> responses) {
  this.context = context;
  this.method = method;
  this.path = path;
  this.bodyProvider = bodyProvider;
  this.chunksProvider = chunksProvider;
  this.delay = delay;
  this.delayUnit = delayUnit;
  this.times = times;
  this.responses = responses;
}
 
Example #3
Source File: MockServerExpectationImpl.java    From mockwebserver with Apache License 2.0 5 votes vote down vote up
private void enqueue(ServerRequest req, ServerResponse resp) {
  Queue<ServerResponse> queuedResponses = responses.get(req);
  if (queuedResponses == null) {
    queuedResponses = new ArrayDeque<>();
    responses.put(req, queuedResponses);
  }
  queuedResponses.add(resp);
}
 
Example #4
Source File: OpenShiftServer.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public void before() {
  mock = curdMode
    ? new OpenShiftMockServer(new Context(), new MockWebServer(), new HashMap<ServerRequest, Queue<ServerResponse>>(), new KubernetesCrudDispatcher(), true)
    : new OpenShiftMockServer(https);
  mock.init();
  client = mock.createOpenShiftClient();
}
 
Example #5
Source File: ServiceCatalogServer.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public void before() {
  mock = curdMode
    ? new ServiceCatalogMockServer(new Context(), new MockWebServer(), new HashMap<ServerRequest, Queue<ServerResponse>>(), new KubernetesCrudDispatcher(), true)
    : new ServiceCatalogMockServer(https);
  mock.init();
  client = mock.createServiceCatalog();
}
 
Example #6
Source File: KubernetesServer.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public void before() {
  mock = crudMode
    ? new KubernetesMockServer(new Context(), new MockWebServer(), new HashMap<ServerRequest, Queue<ServerResponse>>(), new KubernetesCrudDispatcher(), true)
    : new KubernetesMockServer(https);
  mock.init();
  client = mock.createClient();
}
 
Example #7
Source File: TektonServer.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public void before() {
  mock = curdMode
    ? new TektonMockServer(new Context(), new MockWebServer(), new HashMap<ServerRequest, Queue<ServerResponse>>(), new KubernetesCrudDispatcher(), true)
    : new TektonMockServer(https);
  mock.init();
  client = mock.createTekton();
}
 
Example #8
Source File: KnativeServer.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public void before() {
  mock = curdMode
    ? new KnativeMockServer(new Context(), new MockWebServer(), new HashMap<ServerRequest, Queue<ServerResponse>>(), new KubernetesCrudDispatcher(), true)
    : new KnativeMockServer(https);
  mock.init();
  client = mock.createKnative();
}
 
Example #9
Source File: KubernetesMockServer.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public KubernetesMockServer(Context context, MockWebServer server, Map<ServerRequest, Queue<ServerResponse>> responses, boolean useHttps) {
    super(context, server, responses, useHttps);
}
 
Example #10
Source File: MixedDispatcher.java    From flink with Apache License 2.0 4 votes vote down vote up
public MixedDispatcher(Map<ServerRequest, Queue<ServerResponse>> responses) {
	this.responses = responses;
}
 
Example #11
Source File: OpenShiftMockServer.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public OpenShiftMockServer(Context context, MockWebServer server, Map<ServerRequest, Queue<ServerResponse>> responses, Dispatcher dispatcher, boolean useHttps) {
  super(context, server, responses, dispatcher, useHttps);
}
 
Example #12
Source File: ServiceCatalogMockServer.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public ServiceCatalogMockServer(Context context, MockWebServer server, Map<ServerRequest, Queue<ServerResponse>> responses, Dispatcher dispatcher, boolean useHttps) {
  super(context, server, responses, dispatcher, useHttps);
}
 
Example #13
Source File: TektonMockServer.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public TektonMockServer(Context context, MockWebServer server, Map<ServerRequest, Queue<ServerResponse>> responses, Dispatcher dispatcher, boolean useHttps) {
  super(context, server, responses, dispatcher, useHttps);
}
 
Example #14
Source File: KnativeMockServer.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public KnativeMockServer(Context context, MockWebServer server, Map<ServerRequest, Queue<ServerResponse>> responses, Dispatcher dispatcher, boolean useHttps) {
  super(context, server, responses, dispatcher, useHttps);
}
 
Example #15
Source File: MockServerExpectationImpl.java    From mockwebserver with Apache License 2.0 4 votes vote down vote up
public MockServerExpectationImpl(Map<ServerRequest, Queue<ServerResponse>> responses, Context context) {
  this(context, HttpMethod.ANY, null, 200, null, null, 0, TimeUnit.SECONDS, 1, responses);
}
 
Example #16
Source File: KubernetesMockServer.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public KubernetesMockServer(MockWebServer server, Map<ServerRequest, Queue<ServerResponse>> responses, boolean useHttps) {
    this(context, server, responses, useHttps);
}
 
Example #17
Source File: KubernetesMockServer.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public KubernetesMockServer(Context context, MockWebServer server, Map<ServerRequest, Queue<ServerResponse>> responses, Dispatcher dispatcher, boolean useHttps) {
  super(context, server, responses, dispatcher, useHttps);
}
 
Example #18
Source File: KubernetesMockServer.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public KubernetesMockServer(Context context, MockWebServer server, Map<ServerRequest, Queue<ServerResponse>> responses, boolean useHttps) {
    super(context, server, responses, useHttps);
}
 
Example #19
Source File: KubernetesMockServer.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public KubernetesMockServer(MockWebServer server, Map<ServerRequest, Queue<ServerResponse>> responses, boolean useHttps) {
    this(context, server, responses, useHttps);
}
 
Example #20
Source File: MockDispatcher.java    From mockwebserver with Apache License 2.0 4 votes vote down vote up
public MockDispatcher(Map<ServerRequest, Queue<ServerResponse>> responses) {
    this.responses = responses;
}
 
Example #21
Source File: MockServerExpectationImpl.java    From mockwebserver with Apache License 2.0 4 votes vote down vote up
public MockServerExpectationImpl(Context context, HttpMethod method, String path, int statusCode, String body, String[] chunks, long delay, TimeUnit delayUnit, int times, Map<ServerRequest, Queue<ServerResponse>> responses) {
  this(context, method, path, ResponseProviders.of(statusCode, body), ResponseProviders.ofAll(statusCode, chunks), delay, delayUnit, times, responses);
}