Examples of MockWebServer


Examples of com.squareup.okhttp.mockwebserver.MockWebServer

         server.shutdown();
      }
   }

   public void testDestroyNonexistentDroplet() throws Exception {
      MockWebServer server = mockWebServer();
      server.enqueue(new MockResponse().setResponseCode(404));

      DigitalOceanApi api = api(server.getUrl("/"));
      DropletApi dropletApi = api.getDropletApi();

      try {
         try {
            dropletApi.destroy(1);
            fail("Destroy droplet should fail on 404");
         } catch (ResourceNotFoundException ex) {
            // Expected exception
         }

         assertRequestHasCommonFields(server.takeRequest(), "/droplets/1/destroy");
      } finally {
         api.close();
         server.shutdown();
      }
   }
View Full Code Here

Examples of org.jasig.cas.adaptors.x509.util.MockWebServer

       
        super(certFiles, expected);

        this.checker = checker;
        this.checker.setExpiredCRLPolicy(expiredCRLPolicy);
        this.webServer = new MockWebServer(8085, new ClassPathResource(crlFile), "text/plain");
    }
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.