### Question:
Footer extends HBox implements ModuleOwned { @EventListener public void onProgress(PercentageOfWorkDoneChangedEvent event) { statusLabel.setText(DefaultI18nContext.getInstance().i18n("Running")); if (event.isUndetermined()) { bar.setProgress(ProgressIndicator.INDETERMINATE_PROGRESS); } else { bar.setProgress(event.getPercentage().divide(new BigDecimal(100)).doubleValue()); statusLabel.setText(DefaultI18nContext.getInstance().i18n("Running {0}%", Integer.toString(event.getPercentage().intValue()))); } } 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 onProgress() { NotifiableTaskMetadata taskMetadata = mock(NotifiableTaskMetadata.class); PercentageOfWorkDoneChangedEvent event = new PercentageOfWorkDoneChangedEvent(new BigDecimal(50), taskMetadata); victim.onProgress(event); assertFalse(victim.lookup(".footer-failed-button").isVisible()); assertFalse(victim.lookup(".footer-open-button").isVisible()); assertEquals(DefaultI18nContext.getInstance().i18n("Running {0}%", "50"), ((Labeled) victim.lookup(".status-label")).getText()); assertEquals(0.5, ((ProgressBar) victim.lookup(".pdfsam-footer-bar")).getProgress(), 0.01); }
@Test public void onProgressIndeterminate() { NotifiableTaskMetadata taskMetadata = mock(NotifiableTaskMetadata.class); PercentageOfWorkDoneChangedEvent event = new PercentageOfWorkDoneChangedEvent( PercentageOfWorkDoneChangedEvent.UNDETERMINED, taskMetadata); victim.onProgress(event); assertFalse(victim.lookup(".footer-failed-button").isVisible()); assertFalse(victim.lookup(".footer-open-button").isVisible()); assertEquals(DefaultI18nContext.getInstance().i18n("Running"), ((Labeled) victim.lookup(".status-label")).getText()); assertTrue(((ProgressBar) victim.lookup(".pdfsam-footer-bar")).isIndeterminate()); }