Package org.mockserver.model

Examples of org.mockserver.model.HttpCallback


    public void shouldReturnValueSetInConstructor() {
        // given
        HttpRequest httpRequest = new HttpRequest().withBody("some_body");
        HttpResponse httpResponse = new HttpResponse().withBody("some_response_body");
        HttpForward httpForward = new HttpForward().withHost("some_host");
        HttpCallback httpCallback = new HttpCallback().withCallbackClass("some_class");

        // when
        ExpectationDTO expectationWithResponse = new ExpectationDTO(new Expectation(httpRequest, Times.exactly(3)).thenRespond(httpResponse));

        // then
View Full Code Here


    public void shouldBuildObject() {
        // given
        HttpRequest httpRequest = new HttpRequest().withBody("some_body");
        HttpResponse httpResponse = new HttpResponse().withBody("some_response_body");
        HttpForward httpForward = new HttpForward().withHost("some_host");
        HttpCallback httpCallback = new HttpCallback().withCallbackClass("some_class");

        // when
        Expectation expectationWithResponse = new ExpectationDTO(new Expectation(httpRequest, Times.exactly(3)).thenRespond(httpResponse)).buildObject();

        // then
View Full Code Here

        // given
        HttpRequestDTO httpRequest = new HttpRequestDTO(new HttpRequest().withBody("some_body"));
        TimesDTO times = new TimesDTO(Times.exactly(3));
        HttpResponseDTO httpResponse = new HttpResponseDTO(new HttpResponse().withBody("some_response_body"));
        HttpForwardDTO httpForward = new HttpForwardDTO(new HttpForward().withHost("some_host"));
        HttpCallbackDTO httpCallback = new HttpCallbackDTO(new HttpCallback().withCallbackClass("some_class"));

        // when
        ExpectationDTO expectation = new ExpectationDTO();
        expectation.setHttpRequest(httpRequest);
        expectation.setTimes(times);
View Full Code Here

    public void shouldConstructAndGetFields() {
        // given
        HttpRequest httpRequest = new HttpRequest();
        HttpResponse httpResponse = new HttpResponse();
        HttpForward httpForward = new HttpForward();
        HttpCallback httpCallback = new HttpCallback();
        Times times = Times.exactly(3);

        // when
        Expectation expectationThatResponds = new Expectation(httpRequest, times).thenRespond(httpResponse);
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void shouldPreventForwardAfterCallback() {
        // given
        HttpRequest httpRequest = new HttpRequest();
        HttpCallback httpCallback = new HttpCallback();
        HttpForward httpForward = new HttpForward();

        // then
        new Expectation(httpRequest, Times.once()).thenCallback(httpCallback).thenForward(httpForward);
    }
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void shouldPreventResponseAfterCallback() {
        // given
        HttpRequest httpRequest = new HttpRequest();
        HttpCallback httpCallback = new HttpCallback();
        HttpResponse httpResponse = new HttpResponse();

        // then
        new Expectation(httpRequest, Times.once()).thenCallback(httpCallback).thenRespond(httpResponse);
    }
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void shouldPreventCallbackAfterForward() {
        // given
        HttpRequest httpRequest = new HttpRequest();
        HttpResponse httpResponse = new HttpResponse();
        HttpCallback httpCallback = new HttpCallback();

        // then
        new Expectation(httpRequest, Times.once()).thenCallback(httpCallback).thenRespond(httpResponse);
    }
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void shouldPreventCallbackAfterResponse() {
        // given
        HttpRequest httpRequest = new HttpRequest();
        HttpCallback httpCallback = new HttpCallback();
        HttpForward httpForward = new HttpForward();

        // then
        new Expectation(httpRequest, Times.once()).thenCallback(httpCallback).thenForward(httpForward);
    }
View Full Code Here

    public HttpCallbackDTO() {
    }

    public HttpCallback buildObject() {
        return new HttpCallback()
                .withCallbackClass(callbackClass);
    }
View Full Code Here

TOP

Related Classes of org.mockserver.model.HttpCallback

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.