ctx = EasyMock.createNiceMock( UrlRewriteContext.class );
EasyMock.expect( ctx.getDirection() ).andReturn( UrlRewriter.Direction.IN ).anyTimes();
desc = EasyMock.createNiceMock( ServiceUrlFunctionDescriptor.class );
HaProvider haProvider = EasyMock.createNiceMock( HaProvider.class );
EasyMock.expect(env.getAttribute(HaServletContextListener.PROVIDER_ATTRIBUTE_NAME)).andReturn(haProvider).anyTimes();
EasyMock.expect(haProvider.isHaEnabled(EasyMock.anyObject(String.class))).andReturn(Boolean.FALSE).anyTimes();
EasyMock.replay( hm, hms, reg, svc, env, desc, ctx, haProvider);
}