public void testGetRequestWrapperFacadeNull() throws Exception {

    expect(servletContext.getAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE)).andReturn(null);

    replayMocks(servletContext, request, facade);

    assertSame(
        request,
        ModuleIntegrationUtils.getWrappedRequest(request, servletContext, mapping, applicationId));

    verifyMocks(servletContext, request, facade);
  }
  public void testGetRequestWrapper() throws Exception {

    expect(servletContext.getAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE)).andReturn(facade);
    expect(facade.getBean(WebConstants.REQUEST_WRAPPER_FACTORY_BEAN_NAME))
        .andReturn(new IdentityHttpRequestWrapper());

    replayMocks(servletContext, request, facade);

    assertSame(
        request,
        ModuleIntegrationUtils.getWrappedRequest(request, servletContext, mapping, applicationId));

    verifyMocks(servletContext, request, facade);
  }