Package org.mule.transport.http

Examples of org.mule.transport.http.CacheControlHeader


    @Test
    public void testHttpResponseEmptyCacheControl() throws Exception
    {
        HttpResponseBuilder httpResponseBuilder = createHttpResponseBuilder();
        httpResponseBuilder.setCacheControl(new CacheControlHeader());

        HttpResponse response = new HttpResponse();
        httpResponseBuilder.setCacheControl(response, mockMuleMessage);
        assertNull(response.getFirstHeader(HttpConstants.HEADER_CACHE_CONTROL));
    }
View Full Code Here


    @Test
    public void testHttpResponseCacheControl() throws Exception
    {
        HttpResponseBuilder httpResponseBuilder = createHttpResponseBuilder();
        CacheControlHeader cacheControl = new CacheControlHeader();
        cacheControl.setDirective("public");
        cacheControl.setMaxAge("3600");
        cacheControl.setMustRevalidate("true");
        cacheControl.setNoCache("true");
        cacheControl.setNoStore("true");
        httpResponseBuilder.setCacheControl(cacheControl);
        mockParse();

        HttpResponse response = new HttpResponse();
        httpResponseBuilder.setCacheControl(response, mockMuleMessage);
View Full Code Here

    @Test
    public void testHttpResponseCacheControlWithExpressions() throws Exception
    {
        HttpResponseBuilder httpResponseBuilder = createHttpResponseBuilder();
        CacheControlHeader cacheControl = new CacheControlHeader();
        cacheControl.setDirective(HEADER_DIRECTIVE);
        cacheControl.setMaxAge(HEADER_MAX_AGE);
        cacheControl.setMustRevalidate(HEADER_MUST_REVALIDATE);
        cacheControl.setNoCache(HEADER_NO_CACHE);
        cacheControl.setNoStore(HEADER_NO_STORE);
        httpResponseBuilder.setCacheControl(cacheControl);

        when(mockExpressionManager.parse(HEADER_DIRECTIVE, mockMuleMessage)).thenReturn("public");
        when(mockExpressionManager.parse(HEADER_MAX_AGE, mockMuleMessage)).thenReturn("3600");
        when(mockExpressionManager.parse(HEADER_MUST_REVALIDATE, mockMuleMessage)).thenReturn("true");
View Full Code Here

    @Test
    public void testHttpResponseCacheControlWithExtension() throws Exception
    {
        HttpResponseBuilder httpResponseBuilder = createHttpResponseBuilder();
        CacheControlHeader cacheControl = new CacheControlHeader();
        cacheControl.setMaxAge("3600");
        httpResponseBuilder.setCacheControl(cacheControl);
        Map<String, String> headers = new HashMap<String, String>();
        headers.put(HttpConstants.HEADER_CACHE_CONTROL, "smax-age=3600");
        httpResponseBuilder.setHeaders(headers);
        mockParse();
View Full Code Here

    @Test
    public void testHttpResponseWithOutboundProperties() throws Exception
    {
        HttpResponseBuilder httpResponseBuilder = createHttpResponseBuilder();
        CacheControlHeader cacheControl = new CacheControlHeader();
        cacheControl.setMaxAge("3600");
        httpResponseBuilder.setCacheControl(cacheControl);

        Map<String, String> headers = new HashMap<String, String>();
        headers.put(HttpConstants.HEADER_CACHE_CONTROL, "public");
        headers.put(HttpConstants.HEADER_AGE, "12");
View Full Code Here

TOP

Related Classes of org.mule.transport.http.CacheControlHeader

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.