### Question:
Footer extends HBox implements ModuleOwned { @EventListener public void onTaskFailed(TaskExecutionFailedEvent event) { openButton.setVisible(false); failed.setVisible(true); statusLabel.setText(DefaultI18nContext.getInstance().i18n("Failed")); } Footer(RunButton runButton, OpenButton openButton, String ownerModule); OpenButton openButton(); RunButton runButton(); @Override @EventStation String getOwnerModule(); @EventListener void onTaskCompleted(TaskExecutionCompletedEvent event); @EventListener void onTaskFailed(TaskExecutionFailedEvent event); @EventListener void onProgress(PercentageOfWorkDoneChangedEvent event);  }### Answer:
@Test public void onTaskFailed() { TaskExecutionFailedEvent event = mock(TaskExecutionFailedEvent.class); victim.onTaskFailed(event); assertTrue(victim.lookup(".footer-failed-button").isVisible()); assertFalse(victim.lookup(".footer-open-button").isVisible()); assertEquals(DefaultI18nContext.getInstance().i18n("Failed"), ((Labeled) victim.lookup(".status-label")).getText()); assertEquals(0, ((ProgressBar) victim.lookup(".pdfsam-footer-bar")).getProgress(), 0.01); }