Package com.google.mockwebserver

Examples of com.google.mockwebserver.MockResponse


  }

  @Test(dataProvider = "levelToOutput")
  public void levelEmits(final Logger.Level logLevel, List<String> expectedMessages) throws IOException, InterruptedException {
    final MockWebServer server = new MockWebServer();
    server.enqueue(new MockResponse().setBody("foo"));
    server.play();

    try {
      SendsStuff api = Feign.create(SendsStuff.class, "http://localhost:" + server.getUrl("").getPort(),
          new DefaultModule(logger, logLevel));
View Full Code Here


  }

  @Test(dataProvider = "levelToReadTimeoutOutput")
  public void readTimeoutEmits(final Logger.Level logLevel, List<String> expectedMessages) throws IOException, InterruptedException {
    final MockWebServer server = new MockWebServer();
    server.enqueue(new MockResponse().setBytesPerSecond(1).setBody("foo"));
    server.play();


    try {
      SendsStuff api = Feign.create(SendsStuff.class, "http://localhost:" + server.getUrl("").getPort(),
View Full Code Here

  }

  @Test
  public void iterableQueryParams() throws IOException, InterruptedException {
    final MockWebServer server = new MockWebServer();
    server.enqueue(new MockResponse().setBody("foo"));
    server.play();

    try {
      TestInterface api = Feign.create(TestInterface.class, "http://localhost:" + server.getPort(), new TestInterface.Module());
View Full Code Here

  }

  @Test
  public void postTemplateParamsResolve() throws IOException, InterruptedException {
    final MockWebServer server = new MockWebServer();
    server.enqueue(new MockResponse().setBody("foo"));
    server.play();

    try {
      TestInterface api = Feign.create(TestInterface.class, "http://localhost:" + server.getPort(), new TestInterface.Module());
View Full Code Here

  }

  @Test
  public void responseCoercesToStringBody() throws IOException, InterruptedException {
    final MockWebServer server = new MockWebServer();
    server.enqueue(new MockResponse().setBody("foo"));
    server.play();

    try {
      TestInterface api = Feign.create(TestInterface.class, "http://localhost:" + server.getPort(),
          new TestInterface.Module());
View Full Code Here

  }

  @Test
  public void postFormParams() throws IOException, InterruptedException {
    final MockWebServer server = new MockWebServer();
    server.enqueue(new MockResponse().setBody("foo"));
    server.play();

    try {
      TestInterface api = Feign.create(TestInterface.class, "http://localhost:" + server.getPort(), new TestInterface.Module());
View Full Code Here

  }

  @Test
  public void postBodyParam() throws IOException, InterruptedException {
    final MockWebServer server = new MockWebServer();
    server.enqueue(new MockResponse().setBody("foo"));
    server.play();

    try {
      TestInterface api = Feign.create(TestInterface.class, "http://localhost:" + server.getPort(), new TestInterface.Module());
View Full Code Here

  }

  @Test
  public void postGZIPEncodedBodyParam() throws IOException, InterruptedException {
    final MockWebServer server = new MockWebServer();
    server.enqueue(new MockResponse().setBody("foo"));
    server.play();

    try {
      TestInterface api = Feign.create(TestInterface.class, "http://localhost:" + server.getPort(), new TestInterface.Module());
View Full Code Here

  }

  @Test
  public void singleInterceptor() throws IOException, InterruptedException {
    final MockWebServer server = new MockWebServer();
    server.enqueue(new MockResponse().setBody("foo"));
    server.play();

    try {
      TestInterface api = Feign.create(TestInterface.class, "http://localhost:" + server.getPort(),
          new TestInterface.Module(), new ForwardedForInterceptor());
View Full Code Here

  }

  @Test
  public void multipleInterceptor() throws IOException, InterruptedException {
    final MockWebServer server = new MockWebServer();
    server.enqueue(new MockResponse().setBody("foo"));
    server.play();

    try {
      TestInterface api = Feign.create(TestInterface.class, "http://localhost:" + server.getPort(),
          new TestInterface.Module(), new ForwardedForInterceptor(), new UserAgentInterceptor());
View Full Code Here

TOP

Related Classes of com.google.mockwebserver.MockResponse

Copyright © 2018 www.massapicom. 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.