ModuleChangeEvent event = new ModuleChangeEvent(info);
ServletContext servletContext = createMock(ServletContext.class);
final WebModuleChangeListener listener = new WebModuleChangeListener();
listener.setServletContext(servletContext);
ModuleManagementFacade facade = createMock(ModuleManagementFacade.class);
ModuleOperationRegistry moduleOperationRegistry = createMock(ModuleOperationRegistry.class);
ModuleOperation moduleOperation = createMock(ModuleOperation.class);
expect(servletContext.getAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE)).andReturn(facade);
ApplicationManager applicationManager = TestApplicationManager.newApplicationManager();
Application application = applicationManager.getCurrentApplication();
expect(facade.getApplicationManager()).andReturn(applicationManager);
expect(facade.getModuleOperationRegistry()).andReturn(moduleOperationRegistry);
expect(moduleOperationRegistry.getOperation(ModuleOperationConstants.ReloadNamedModuleOperation)).andReturn(moduleOperation);
expect(moduleOperation.execute(eq(application), isA(ModuleOperationInput.class))).andReturn(ModuleOperationResult.EMPTY);
replay(servletContext);
replay(facade);
replay(moduleOperationRegistry);