Package com.github.restdriver.clientdriver

Examples of com.github.restdriver.clientdriver.ClientDriverFactory


       
    }
   
    @Test
    public void testUnmatchedExpectation() throws Exception {
        clientDriver = new ClientDriverFactory().createClientDriver();
       
        clientDriver.addExpectation(onRequestTo("/blah"), giveResponse("OUCH!!", "text/plain").withStatus(200));
        clientDriver.addExpectation(onRequestTo("/blah"), giveResponse("OUCH!!", "text/plain").withStatus(404));
       
        // no requests made
View Full Code Here


       
    }
   
    @Test
    public void testJettyWorkingWithMethodButIncorrectParams() throws Exception {
        clientDriver = new ClientDriverFactory().createClientDriver();
       
        clientDriver.addExpectation(onRequestTo("/blah").withMethod(Method.POST).withParam("gang", "green"),
                giveResponse("OUCH!!", "text/plain").withStatus(200).withHeader("Server", "TestServer"));
       
        HttpClient client = new DefaultHttpClient();
View Full Code Here

       
    }
   
    @Test
    public void testJettyWorkingWithMethodButIncorrectParamsPattern() throws Exception {
        clientDriver = new ClientDriverFactory().createClientDriver();
       
        clientDriver.addExpectation(onRequestTo(Pattern.compile("/b[a-z]{3}")).withMethod(Method.POST).withParam(
                "gang", Pattern.compile("r")), giveResponse("OUCH!!", "text/plain").withStatus(200).withHeader("Server", "TestServer"));
       
        HttpClient client = new DefaultHttpClient();
View Full Code Here

       
    }
   
    @Test
    public void testJettyWorkingWithIncorrectHeaderString() throws Exception {
        clientDriver = new ClientDriverFactory().createClientDriver();
       
        clientDriver.addExpectation(onRequestTo("/test").withHeader("Content-Length", "1234"),
                giveEmptyResponse().withStatus(204).withHeader("Content-Type", "abcd"));
       
        HttpClient client = new DefaultHttpClient();
View Full Code Here

TOP

Related Classes of com.github.restdriver.clientdriver.ClientDriverFactory

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.