Package org.mockserver.model

Examples of org.mockserver.model.HttpResponse


    }

    @Test
    public void doesNotMatchIncorrectBinaryBody() {
        byte[] matched = "some other binary value".getBytes();
        assertFalse(new HttpResponseMatcher(new HttpResponse().withBody(binary("some binary value".getBytes()))).matches(new HttpResponse().withBody(matched)));
    }
View Full Code Here


        assertFalse(new HttpResponseMatcher(new HttpResponse().withBody(binary("some binary value".getBytes()))).matches(new HttpResponse().withBody(matched)));
    }

    @Test
    public void matchesMatchingHeaders() {
        assertTrue(new HttpResponseMatcher(new HttpResponse().withHeaders(new Header("name", "value"))).matches(new HttpResponse().withHeaders(new Header("name", "value"))));
    }
View Full Code Here

        assertTrue(new HttpResponseMatcher(new HttpResponse().withHeaders(new Header("name", "value"))).matches(new HttpResponse().withHeaders(new Header("name", "value"))));
    }

    @Test
    public void matchesMatchingHeadersWithRegex() {
        assertTrue(new HttpResponseMatcher(new HttpResponse().withHeaders(new Header("name", ".*"))).matches(new HttpResponse().withHeaders(new Header("name", "value"))));
    }
View Full Code Here

        assertTrue(new HttpResponseMatcher(new HttpResponse().withHeaders(new Header("name", ".*"))).matches(new HttpResponse().withHeaders(new Header("name", "value"))));
    }

    @Test
    public void doesNotMatchIncorrectHeaderName() {
        assertFalse(new HttpResponseMatcher(new HttpResponse().withHeaders(new Header("name", "value"))).matches(new HttpResponse().withHeaders(new Header("name1", "value"))));
    }
View Full Code Here

        assertFalse(new HttpResponseMatcher(new HttpResponse().withHeaders(new Header("name", "value"))).matches(new HttpResponse().withHeaders(new Header("name1", "value"))));
    }

    @Test
    public void doesNotMatchIncorrectHeaderValue() {
        assertFalse(new HttpResponseMatcher(new HttpResponse().withHeaders(new Header("name", "value"))).matches(new HttpResponse().withHeaders(new Header("name", "value1"))));
    }
View Full Code Here

        assertFalse(new HttpResponseMatcher(new HttpResponse().withHeaders(new Header("name", "value"))).matches(new HttpResponse().withHeaders(new Header("name", "value1"))));
    }

    @Test
    public void doesNotMatchIncorrectHeaderValueRegex() {
        assertFalse(new HttpResponseMatcher(new HttpResponse().withHeaders(new Header("name", "[0-9]{0,100}"))).matches(new HttpResponse().withHeaders(new Header("name", "value1"))));
    }
View Full Code Here

        assertFalse(new HttpResponseMatcher(new HttpResponse().withHeaders(new Header("name", "[0-9]{0,100}"))).matches(new HttpResponse().withHeaders(new Header("name", "value1"))));
    }

    @Test
    public void matchesMatchingCookies() {
        assertTrue(new HttpResponseMatcher(new HttpResponse().withCookies(new Cookie("name", "value"))).matches(new HttpResponse().withCookies(new Cookie("name", "value"))));
    }
View Full Code Here

        assertTrue(new HttpResponseMatcher(new HttpResponse().withCookies(new Cookie("name", "value"))).matches(new HttpResponse().withCookies(new Cookie("name", "value"))));
    }

    @Test
    public void matchesMatchingCookiesWithRegex() {
        assertTrue(new HttpResponseMatcher(new HttpResponse().withCookies(new Cookie("name", "[a-z]{0,20}lue"))).matches(new HttpResponse().withCookies(new Cookie("name", "value"))));
    }
View Full Code Here

        assertTrue(new HttpResponseMatcher(new HttpResponse().withCookies(new Cookie("name", "[a-z]{0,20}lue"))).matches(new HttpResponse().withCookies(new Cookie("name", "value"))));
    }

    @Test
    public void doesNotMatchIncorrectCookieName() {
        assertFalse(new HttpResponseMatcher(new HttpResponse().withCookies(new Cookie("name", "value"))).matches(new HttpResponse().withCookies(new Cookie("name1", "value"))));
    }
View Full Code Here

        assertFalse(new HttpResponseMatcher(new HttpResponse().withCookies(new Cookie("name", "value"))).matches(new HttpResponse().withCookies(new Cookie("name1", "value"))));
    }

    @Test
    public void doesNotMatchIncorrectCookieValue() {
        assertFalse(new HttpResponseMatcher(new HttpResponse().withCookies(new Cookie("name", "value"))).matches(new HttpResponse().withCookies(new Cookie("name", "value1"))));
    }
View Full Code Here

TOP

Related Classes of org.mockserver.model.HttpResponse

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.