Package org.mockserver.model

Examples of org.mockserver.model.ParameterBody


public class ParameterBodyDTOTest {

    @Test
    public void shouldReturnValueSetInConstructor() {
        // when
        ParameterBodyDTO parameterBody = new ParameterBodyDTO(new ParameterBody(
                new Parameter("some", "value")
        ));

        // then
        assertThat(parameterBody.getParameters(), containsInAnyOrder(new ParameterDTO(new Parameter("some", "value"))));
View Full Code Here


    }

    @Test
    public void shouldBuildCorrectObject() {
        // when
        ParameterBody parameterBody = new ParameterBodyDTO(new ParameterBody(
                new Parameter("some", "value")
        )).buildObject();

        // then
        assertThat(parameterBody.getValue(), containsInAnyOrder(new Parameter("some", "value")));
        assertThat(parameterBody.getType(), is(Body.Type.PARAMETERS));
    }
View Full Code Here

    public void shouldReturnCorrectObjectFromStaticBuilder() {
        assertThat(params(
                        new Parameter("some", "value")
                ),
                is(
                        new ParameterBody(
                                new Parameter("some", "value")
                        )
                )
        );
        assertThat(params(Arrays.asList(
                        new Parameter("some", "value")
                )),
                is(
                        new ParameterBody(
                                new Parameter("some", "value")
                        )
                )
        );
    }
View Full Code Here

    public List<ParameterDTO> getParameters() {
        return parameters;
    }

    public ParameterBody buildObject() {
        return new ParameterBody(Lists.transform(parameters, new Function<ParameterDTO, Parameter>() {
            public Parameter apply(ParameterDTO parameterDTO) {
                return parameterDTO.buildObject();
            }
        }));
    }
View Full Code Here

TOP

Related Classes of org.mockserver.model.ParameterBody

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.