Search in sources :

Example 1 with RestParamsPropertyHolder

use of com.eviware.soapui.impl.rest.support.RestParamsPropertyHolder in project microcks by microcks.

the class SoapUIProjectImporter method buildRequest.

/**
 * Build a domain Request from SoapUI RestTestRequest.
 */
private Request buildRequest(RestTestRequest rtr) {
    Request request = new Request();
    request.setName(rtr.getName());
    request.setContent(rtr.getRequestContent());
    request.setHeaders(buildHeaders(rtr.getRequestHeaders()));
    // Add query parameters only (template are holded by the operation itself.)
    RestParamsPropertyHolder paramsHolder = rtr.getParams();
    for (int i = 0; i < paramsHolder.getPropertyCount(); i++) {
        // if (paramsHolder.getPropertyAt(i).getStyle() == ParameterStyle.QUERY){
        Parameter param = new Parameter();
        param.setName(paramsHolder.getPropertyAt(i).getName());
        param.setValue(paramsHolder.getPropertyAt(i).getValue());
        request.addQueryParameter(param);
    // }
    }
    return request;
}
Also used : RestParamsPropertyHolder(com.eviware.soapui.impl.rest.support.RestParamsPropertyHolder) WsdlTestRequest(com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequest) RestTestRequest(com.eviware.soapui.impl.wsdl.teststeps.RestTestRequest)

Aggregations

RestParamsPropertyHolder (com.eviware.soapui.impl.rest.support.RestParamsPropertyHolder)1 RestTestRequest (com.eviware.soapui.impl.wsdl.teststeps.RestTestRequest)1 WsdlTestRequest (com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequest)1