Package org.mockserver.model

Examples of org.mockserver.model.Parameter


    }

    @Test
    public void shouldNotMatchIncorrectParameterValue() {
        assertFalse(new ParameterStringMatcher(Arrays.asList(
                new Parameter("parameterOneName", "parameterOneValueOne", "parameterOneValueTwo"),
                new Parameter("parameterTwoName", "parameterTwoValue")
        )).matches("" +
                "parameterOneName=parameterOneValueOne" +
                "&parameterOneName=parameterOneValueTwo" +
                "&parameterTwoName=INCORRECTParameterTwoValue"));
    }
View Full Code Here


    }

    @Test
    public void shouldNotMatchIncorrectParameterNameAndValue() {
        assertFalse(new ParameterStringMatcher(Arrays.asList(
                new Parameter("parameterOneName", "parameterOneValueOne", "parameterOneValueTwo"),
                new Parameter("parameterTwoName", "parameterTwoValue")
        )).matches("" +
                "parameterOneName=parameterOneValueOne" +
                "&parameterOneName=parameterOneValueTwo" +
                "&INCORRECTParameterTwoName=INCORRECTParameterTwoValue"));
    }
View Full Code Here

    }

    @Test
    public void shouldNotMatchNullParameterValue() {
        assertFalse(new ParameterStringMatcher(Arrays.asList(
                new Parameter("parameterOneName", "parameterValueOne"),
                new Parameter("parameterTwoName", "parameterTwoValue")
        )).matches("" +
                "parameterOneName=parameterValueOne" +
                "&parameterTwoName="));
    }
View Full Code Here

    }

    @Test
    public void shouldMatchNullParameterValueInExpectation() {
        assertTrue(new ParameterStringMatcher(Arrays.asList(
                new Parameter("parameterOneName", "parameterValueOne"),
                new Parameter("parameterTwoName", "")
        )).matches("" +
                "parameterOneName=parameterValueOne" +
                "&parameterTwoName=parameterTwoValue"));
    }
View Full Code Here

    }

    @Test
    public void shouldNotMatchMissingParameter() {
        assertFalse(new ParameterStringMatcher(Arrays.asList(
                new Parameter("parameterOneName", "parameterValueOne"),
                new Parameter("parameterTwoName", "parameterTwoValue")
        )).matches("" +
                "parameterOneName=parameterValueOne"));
    }
View Full Code Here

        for (String name : parameters.keySet()) {
            for (String value : parameters.get(name)) {
                if (mappedParameters.containsKey(name)) {
                    mappedParameters.get(name).addValue(value);
                } else {
                    mappedParameters.put(name, new Parameter(name, value));
                }
            }
        }
        return new ArrayList<KeyToMultiValue>(mappedParameters.values());
    }
View Full Code Here

        HttpResponse httpResponseActual = apacheHttpClient.sendRequest(new HttpRequest()
                        .withMethod("POST")
                        .withURL("http://host:8080/path")
                        .withPath("/path")
                        .withQueryStringParameters(
                                new Parameter("paramOneName", "paramOneValueOne", "paramOneValueTwo"),
                                new Parameter("paramTwoName", "paramTwoValue")
                        )
                        .withHeaders(
                                new org.mockserver.model.Header("headerOneName", "headerOneValueOne", "headerOneValueTwo"),
                                new org.mockserver.model.Header("headerTwoName", "headerTwoValue")
                        )
View Full Code Here

        apacheHttpClient.sendRequest(new HttpRequest()
                        .withMethod("GET")
                        .withURL("http://host:8080/path")
                        .withPath("/path")
                        .withQueryStringParameters(
                                new Parameter("paramOneName", "paramOneValueOne", "paramOneValueTwo"),
                                new Parameter("paramTwoName", "paramTwoValue"),
                                new Parameter("paramThreeName")
                        )
                        .withHeaders(
                                new org.mockserver.model.Header("headerOneName", "headerOneValueOne", "headerOneValueTwo"),
                                new org.mockserver.model.Header("headerTwoName", "headerTwoValue"),
                                new org.mockserver.model.Header("headerThreeName")
View Full Code Here

    protected ParameterDTO() {
    }

    public Parameter buildObject() {
        return new Parameter(getName(), getValues());
    }
View Full Code Here

TOP

Related Classes of org.mockserver.model.Parameter

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.