@Test
    //Verifies fix for JSEC-94
    public void testRemoveValue() throws Exception {

        //verify that the cookie header starts with what we want
        //we can't verify the exact date format string that is appended, so we resort to just
        //simple 'startsWith' matching, which is good enough:
        String name = "test";
        String value = "deleteMe";
        String path = "/somepath";

        String headerValue = this.cookie.buildHeaderValue(name, value, null, null, path,
                0, SimpleCookie.DEFAULT_VERSION, false, false, null);

        String expectedStart = new StringBuilder()
                .append(name).append(SimpleCookie.NAME_VALUE_DELIMITER).append(value)
                .append(SimpleCookie.ATTRIBUTE_DELIMITER)
                .append(SimpleCookie.PATH_ATTRIBUTE_NAME).append(SimpleCookie.NAME_VALUE_DELIMITER).append(path)
                .toString();

        assertTrue(headerValue.startsWith(expectedStart));

        expect(mockRequest.getContextPath()).andReturn(path).times(1);
        //can't calculate the date format in the test
        mockResponse.addHeader(eq(SimpleCookie.COOKIE_HEADER_NAME), isA(String.class));
        replay(mockRequest);
        replay(mockResponse);

        this.cookie.removeFrom(mockRequest, mockResponse);

        verify(mockRequest);
        verify(mockResponse);
    }
TODO - Class JavaDoc

@since Apr 22, 2010 9:40:47 PM
web/src/test/java/org/apache/shiro/web/servlet/SimpleCookieTest.java