Package com.google.mockwebserver

Examples of com.google.mockwebserver.MockWebServer.shutdown()


      TestInterface api = Feign.create(TestInterface.class, "http://localhost:" + server.getPort(),
          new IOEOnDecode());

      api.post();
    } finally {
      server.shutdown();
      assertEquals(server.getRequestCount(), 1);
    }
  }

  @Module(overrides = true, includes = TestInterface.Module.class)
View Full Code Here


    try {
      TestInterface api = Feign.create(TestInterface.class, "https://localhost:" + server.getPort(),
          new TrustSSLSockets());
      api.post();
    } finally {
      server.shutdown();
    }
  }

  @Module(overrides = true, includes = TrustSSLSockets.class)
  static class DisableHostnameVerification {
View Full Code Here

    try {
      TestInterface api = Feign.create(TestInterface.class, "https://localhost:" + server.getPort(),
          new DisableHostnameVerification());
      api.post();
    } finally {
      server.shutdown();
    }
  }

  @Test public void retriesFailedHandshake() throws IOException, InterruptedException {
    MockWebServer server = new MockWebServer();
View Full Code Here

      TestInterface api = Feign.create(TestInterface.class, "https://localhost:" + server.getPort(),
          new TestInterface.Module(), new TrustSSLSockets());
      api.post();
      assertEquals(server.getRequestCount(), 2);
    } finally {
      server.shutdown();
    }
  }

  @Test public void equalsAndHashCodeWork() {
    TestInterface i1 = Feign.create(TestInterface.class, "http://localhost:8080", new TestInterface.Module());
View Full Code Here

      OtherTestInterface api = Feign.builder().target(OtherTestInterface.class, "http://localhost:" + server.getPort());

      byte[] actualResponse = api.binaryResponseBody();
      assertEquals(actualResponse, expectedResponse);
    } finally {
      server.shutdown();
    }
  }

  @Test public void encodeLogicSupportsByteArray() throws Exception {
    byte[] expectedRequest = {12, 34, 56};
View Full Code Here

      api.binaryRequestBody(expectedRequest);
      byte[] actualRequest = server.takeRequest().getBody();
      assertEquals(actualRequest, expectedRequest);
    } finally {
      server.shutdown();
    }
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.