@Test
public void check_redirect_needed() throws Exception
{
Request request = mockRequest();
Response response = mockResponse();
LinkFactory linkFactory = mockLinkFactory();
MetaDataLocator locator = mockMetaDataLocator();
BaseURLSource source = mockBaseURLSource();
Page page = mockPage();
Link link = mockLink();
RequestPageCache cache = mockRequestPageCache();
train_isSecure(request, false);
train_get(cache, PAGE_NAME, page);
train_isSecure(locator, page, true);
train_createPageLink(linkFactory, page, link);
response.sendRedirect(link);
replay();
RequestSecurityManager manager
= new RequestSecurityManagerImpl(request, response, linkFactory, locator, source, cache);