Package com.eviware.soapui.support.types

Examples of com.eviware.soapui.support.types.StringToStringsMap


    }

    protected abstract String removeEmptyContent(String responseContent);

    public void setResponseHeaders(StringToStringsMap headers) {
        StringToStringsMap oldHeaders = getResponseHeaders();

        getConfig().setHeaderArray(new HeaderConfig[0]);

        for (Map.Entry<String, List<String>> header : headers.entrySet()) {
            for (String value : header.getValue()) {
View Full Code Here


        return new Attachment[0];
    }

    @Override
    public StringToStringsMap getRequestHeaders() {
        return new StringToStringsMap();
    }
View Full Code Here

        return new StringToStringsMap();
    }

    @Override
    public StringToStringsMap getResponseHeaders() {
        return new StringToStringsMap();
    }
View Full Code Here

        return Boolean.valueOf(System.getProperty(CACHE_HEADERS_SYSTEM_PROPERTY, "true"));
    }

    private void addHeadersToRequest(SubmitContext context, AbstractHttpRequest<?> request) {
        // get existing and save
        StringToStringsMap headers = request.getRequestHeaders();
        savedHeaders.put(request, createCopyOfHeaders(headers));

        boolean replaceHeaders = isReplaceHeaders();

        for (String name : headersToAdd.keySet()) {
            // remove existing if replace is enabled
            if (replaceHeaders && headers.containsKey(name))
                headers.get(name).clear();

            // add header values
            for (String value : headersToAdd.get(name)) {
                headers.add(name, PropertyExpander.expandProperties(context, value));
            }
        }

        request.setRequestHeaders(headers);
    }
View Full Code Here

    private boolean isReplaceHeaders() {
        return Boolean.valueOf(System.getProperty(REPLACE_HEADERS_SYSTEM_PROPERTY, "false"));
    }

    private StringToStringsMap createCopyOfHeaders(StringToStringsMap headers) {
        StringToStringsMap result = new StringToStringsMap();

        for (String name : headers.keySet()) {
            result.put(name, new ArrayList<String>(headers.get(name)));
        }

        return result;
    }
View Full Code Here

        return result;
    }

    private void initHeadersToAdd() {
        headersToAdd = new StringToStringsMap(globalHeadersToAdd);

        for (Object key : System.getProperties().keySet()) {
            if (String.valueOf(key).startsWith(HEADER_SYSTEM_PROPERTY_PREFIX)) {
                String headerName = String.valueOf(key).substring(HEADER_SYSTEM_PROPERTY_PREFIX.length());
                if (headerName.length() > 0) {
View Full Code Here

        assertThat(mockResult.getMockResponse().getResponseContent(), is(responseContent));
    }

    @Test
    public void testDispatchRequestReturnsHttpHeader() throws Exception {
        StringToStringsMap responseHeaders = mockResponse.getResponseHeaders();
        String headerKey = "awesomekey";
        String headerValue = "awesomevalue";
        responseHeaders.add(headerKey, headerValue);
        mockResponse.setResponseHeaders(responseHeaders);

        WsdlMockResult mockResult = mockOperation.dispatchRequest(restMockRequest);

        // HttpResponse is the response transferred over the wire.
View Full Code Here

    @Test
    public void testDispatchRequestReturnsExpandedHttpHeader() throws Exception {
        String expandedValue = "application/json; charset=iso-8859-1";
        mockResponse.getMockOperation().getMockService().setPropertyValue("ContentType", expandedValue);

        StringToStringsMap responseHeaders = mockResponse.getResponseHeaders();
        String headerKey = "ContentType";
        String headerValue = "${#MockService#ContentType}";
        responseHeaders.add(headerKey, headerValue);
        mockResponse.setResponseHeaders(responseHeaders);

        WsdlMockResult mockResult = mockOperation.dispatchRequest(restMockRequest);

        // HttpResponse is the response transferred over the wire.
View Full Code Here

        String responseContent = getResponseContent();
        return XmlUtils.seemsToBeXml(responseContent) ? responseContent : null;
    }

    public StringToStringsMap getResponseHeaders() {
        return getResponse() == null ? new StringToStringsMap() : getResponse().getResponseHeaders();
    }
View Full Code Here

    public String getRequestContentAsXml() {
        return null;
    }

    public StringToStringsMap getRequestHeaders() {
        return new StringToStringsMap();
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.support.types.StringToStringsMap

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.