Examples of Expectation


Examples of org.mockserver.mock.Expectation

                "        }" + System.getProperty("line.separator") +
                "    }" + System.getProperty("line.separator") +
                "}");

        // when
        Expectation expectation = new ExpectationSerializer().deserialize(requestBytes);

        // then
        assertEquals(new ExpectationDTO()
                .setHttpRequest(
                        new HttpRequestDTO()
View Full Code Here

Examples of org.mockserver.mock.Expectation

                "          \"body\": \"someBody\"," + System.getProperty("line.separator") +
                "          \"extra_field\": \"extra_value\"" + System.getProperty("line.separator") +
                "      }" + System.getProperty("line.separator") +
                "  }" +
                "]");
        Expectation expectation = new ExpectationDTO()
                .setHttpRequest(
                        new HttpRequestDTO()
                                .setPath("somePath")
                )
                .setHttpResponse(
View Full Code Here

Examples of org.mockserver.mock.Expectation

                "    \"unlimited\" : false" + System.getProperty("line.separator") +
                "  }" + System.getProperty("line.separator") +
                "}");

        // when
        Expectation expectation = new ExpectationSerializer().deserialize(requestBytes);

        // then
        assertEquals(new ExpectationDTO()
                .setHttpRequest(
                        new HttpRequestDTO()
View Full Code Here

Examples of org.mockserver.mock.Expectation

                "    \"unlimited\" : false" + System.getProperty("line.separator") +
                "  }" + System.getProperty("line.separator") +
                "}");

        // when
        Expectation expectation = new ExpectationSerializer().deserialize(requestBytes);

        // then
        assertEquals(new ExpectationDTO()
                        .setHttpRequest(
                                new HttpRequestDTO()
View Full Code Here

Examples of org.mockserver.mock.Expectation

                "    \"unlimited\" : false" + System.getProperty("line.separator") +
                "  }" + System.getProperty("line.separator") +
                "}");

        // when
        Expectation expectation = new ExpectationSerializer().deserialize(requestBytes);

        // then
        assertEquals(new ExpectationDTO()
                        .setHttpRequest(
                                new HttpRequestDTO()
View Full Code Here

Examples of org.mockserver.mock.Expectation

                "        \"body\": \"someBody\"" + System.getProperty("line.separator") +
                "    }" + System.getProperty("line.separator") +
                "}");

        // when
        Expectation expectation = new ExpectationSerializer().deserialize(requestBytes);

        // then
        assertEquals(new ExpectationDTO()
                .setHttpRequest(
                        new HttpRequestDTO()
View Full Code Here

Examples of org.mockserver.mock.Expectation

                "        \"body\": \"someBody\"" + System.getProperty("line.separator") +
                "    }" + System.getProperty("line.separator") +
                "}");

        // when
        Expectation expectation = new ExpectationSerializer().deserialize(requestBytes);

        // then
        assertEquals(new ExpectationDTO()
                .setHttpRequest(
                        new HttpRequestDTO()
View Full Code Here

Examples of org.mockserver.mock.Expectation

                "        \"body\": \"someBody\"" + System.getProperty("line.separator") +
                "    }" + System.getProperty("line.separator") +
                "}");

        // when
        Expectation expectation = new ExpectationSerializer().deserialize(requestBytes);

        // then
        assertEquals(new ExpectationDTO()
                .setHttpRequest(
                        new HttpRequestDTO()
View Full Code Here

Examples of org.mockserver.mock.Expectation

    }

    @Test
    public void shouldSerializePartialExpectationArray() throws IOException {
        // when
        Expectation expectation = new ExpectationDTO()
                .setHttpRequest(
                        new HttpRequestDTO()
                                .setPath("somePath")
                )
                .setHttpResponse(
View Full Code Here

Examples of org.mockserver.mock.Expectation

        logFilter.onResponse(httpRequest, httpResponseThree);

        // then
        assertArrayEquals(logFilter.retrieve(null),
                new Expectation[]{
                        new Expectation(httpRequest, Times.once()).thenRespond(httpResponseOne),
                        new Expectation(httpRequest, Times.once()).thenRespond(httpResponseThree),
                        new Expectation(otherHttpRequest, Times.once()).thenRespond(httpResponseTwo)
                });
        assertArrayEquals(logFilter.retrieve(new HttpRequest()),
                new Expectation[]{
                        new Expectation(httpRequest, Times.once()).thenRespond(httpResponseOne),
                        new Expectation(httpRequest, Times.once()).thenRespond(httpResponseThree),
                        new Expectation(otherHttpRequest, Times.once()).thenRespond(httpResponseTwo)
                });
        assertArrayEquals(logFilter.retrieve(new HttpRequest().withPath("some_path")),
                new Expectation[]{
                        new Expectation(httpRequest, Times.once()).thenRespond(httpResponseOne),
                        new Expectation(httpRequest, Times.once()).thenRespond(httpResponseThree)
                });
        assertArrayEquals(logFilter.retrieve(new HttpRequest().withPath("some_other_path")),
                new Expectation[]{
                        new Expectation(otherHttpRequest, Times.once()).thenRespond(httpResponseTwo)
                });
    }
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.