Package com.eviware.soapui.impl.rest.support

Examples of com.eviware.soapui.impl.rest.support.RestParamProperty


        assertThat(availableStyles, hasItem(RestParamsPropertyHolder.ParameterStyle.TEMPLATE));
    }

    @Test
    public void disallowsMethodLocationForTemplateParameter() throws Exception {
        RestParamProperty prop = params.addProperty("prop");
        prop.setParamLocation(NewRestResourceActionBase.ParamLocation.RESOURCE);
        prop.setStyle(RestParamsPropertyHolder.ParameterStyle.TEMPLATE);
        List<NewRestResourceActionBase.ParamLocation> availableLocations = getParameterLocations();
        assertThat(availableLocations, not(hasItem(NewRestResourceActionBase.ParamLocation.METHOD)));
    }
View Full Code Here


        assertThat(availableLocations, not(hasItem(NewRestResourceActionBase.ParamLocation.METHOD)));
    }

    @Test
    public void disallowsMethodLocationForTemplateParameterOnMethodLevel() throws Exception {
        RestParamProperty prop = params.addProperty("prop");
        prop.setParamLocation(NewRestResourceActionBase.ParamLocation.METHOD);
        prop.setStyle(RestParamsPropertyHolder.ParameterStyle.TEMPLATE);
        List<NewRestResourceActionBase.ParamLocation> availableLocations = getParameterLocations();
        assertThat(availableLocations, not(hasItem(NewRestResourceActionBase.ParamLocation.METHOD)));
    }
View Full Code Here

        assertThat(availableLocations, not(hasItem(NewRestResourceActionBase.ParamLocation.METHOD)));
    }

    @Test
    public void allowsMethodLocationForQueryParameter() throws Exception {
        RestParamProperty prop = params.addProperty("prop");
        prop.setParamLocation(NewRestResourceActionBase.ParamLocation.RESOURCE);
        prop.setStyle(RestParamsPropertyHolder.ParameterStyle.QUERY);
        List<NewRestResourceActionBase.ParamLocation> availableLocations = getParameterLocations();
        assertThat(availableLocations, hasItem(NewRestResourceActionBase.ParamLocation.METHOD));
    }
View Full Code Here

    @Test
    public void shouldGenerateRestMockServiceForNestedResources() {
        RestResource one = restService.addNewResource("one", "/one{version}");

        RestParamProperty path = one.addProperty("version");
        path.setValue("v1");

        RestResourceConfig nestedResourceConfig = one.getConfig().addNewResource();
        nestedResourceConfig.setPath("/path/again");

        RestResource three = one.addNewChildResource("three", "/will/be/overwritten");
View Full Code Here

    }

    @Test
    public void shouldExpandPathParamForEmptyRestMethod() {
        RestResource resource = restService.addNewResource("one", "/one{version}");
        RestParamProperty path = resource.addProperty("version");
        path.setValue("v1");

        addMethod(resource, HttpMethod.GET);

        action.perform(restService, null);
View Full Code Here

    @Before
    public void setUp() throws SoapUIException {
        RestRequest restRequest = ModelItemFactory.makeRestRequest();
        params = restRequest.getParams();
        RestParamProperty param = params.addProperty(PARAM_NAME_1);
        param.setParamLocation(METHOD);
        RestParamProperty param2 = params.addProperty(PARAM_NAME_2);
        param2.setParamLocation(METHOD);

        restParamsTableModel = new RestParamsTableModel(params);
    }
View Full Code Here

        assertThat(mediaTypeHandler.createXmlRepresentation(responseWithNewPath), is(equalTo(originalXml)));
    }

    @Test
    public void usesActualUriWhenPathContainsTemplateParameters() throws Exception {
        RestParamProperty userParameter = restRequest.getParams().addProperty("user");
        userParameter.setStyle(RestParamsPropertyHolder.ParameterStyle.TEMPLATE);
        userParameter.setValue("billy");

        String originalPath = "/original/{user}";
        restRequest.setPath(originalPath);

        SubmitContext submitContext = submitRequest(restRequest, originalPath);
View Full Code Here

    static void scanForTemplateParameters(RestResource resource) {
        for (RestResource restResource : RestUtils.extractAncestorsParentFirst(resource)) {
            for (String p : RestUtils.extractTemplateParams(restResource.getPath())) {
                if (!resourceOrParentHasProperty(restResource, p)) {
                    RestParamProperty property = restResource.addProperty(p);
                    property.setStyle(RestParamsPropertyHolder.ParameterStyle.TEMPLATE);
                    String value = UISupport.prompt("Specify default value for parameter [" + p + "]",
                            "Add Parameter", "");
                    if (value != null) {
                        property.setDefaultValue(value);
                        property.setValue(value);
                    }
                }
            }
        }
    }
View Full Code Here

    @Test
    public void considersBasePathWhenAddingTemplateParameter() throws Exception {
        String parameterName = "version";
        String parameterInPath = "{" + parameterName + "}";
        parentService.setBasePath("/base/" + parameterInPath);
        RestParamProperty parameter = restResource.addProperty(parameterName);
        parameter.setStyle(RestParamsPropertyHolder.ParameterStyle.TEMPLATE);

        assertThat(restResource.getPath(), not(containsString(parameterInPath)));
    }
View Full Code Here

        assertThat(request, hasARestParameterNamed(PARAMETER_NAME).withValue(PARAMETER_VALUE));
    }

    @Test
    public void retainsParameterValueWhenChangingItsLevel() {
        RestParamProperty parameter = request.getParams().addProperty(PARAMETER_NAME);
        parameter.setValue(PARAMETER_VALUE);
        parameter.setParamLocation(NewRestResourceActionBase.ParamLocation.RESOURCE);
        RestParamProperty returnedParameter = request.getParams().getProperty(PARAMETER_NAME);
        returnedParameter.setParamLocation(NewRestResourceActionBase.ParamLocation.METHOD);

        assertThat(request, hasARestParameterNamed(PARAMETER_NAME).withValue(PARAMETER_VALUE));
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.rest.support.RestParamProperty

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.