ProcessInstanceDiagramPresenter implements ProcessInstanceSummaryAware { public void onTimerInstanceReschedule(final TimerInstanceSummary summary) { processService.call((Void) -> { notification.fire(new NotificationEvent(constants.TimerInstanceRescheduled(summary.getLabel()), NotificationEvent.NotificationType.SUCCESS)); refreshDetails(); }).rescheduleTimerInstance(processInstance.getProcessInstanceKey(), summary); }  @PostConstruct void init(); @Override void setProcessInstance(ProcessInstanceSummary processInstance); void onProcessInstanceSelectionEvent(@Observes final ProcessInstanceSelectionEvent event); void displayImage(final String svgContent, final String containerId); void onDiagramNodeSelected(final String nodeId); void onProcessNodeTrigger(final ProcessNodeSummary node); void listenParentProcessInstanceSelected(); void onNodeInstanceReTrigger(final NodeInstanceSummary node); void onNodeInstanceCancel(final NodeInstanceSummary node); void onTimerInstanceReschedule(final TimerInstanceSummary summary); void onShow(); @WorkbenchPartTitle String getName(); @WorkbenchPartView IsWidget getView(); @Inject void setProcessService(final Caller<ProcessRuntimeDataService> processService); void onProcessDiagramExpandEvent(@Observes ProcessDiagramExpandEvent event);  }
@Test public void testOnTimerInstanceReschedule() { ProcessInstanceSummary processInstance = ProcessInstanceSummary.builder().withServerTemplateId("serverTemplateId").withDeploymentId("containerId").withProcessInstanceId(1l).withState(ProcessInstance.STATE_ACTIVE).build(); final TimerInstanceSummary timer = TimerInstanceSummary.builder().withId(1l).withName("t1").build(); List<TimerInstanceSummary> timerInstance = Arrays.asList( timer, TimerInstanceSummary.builder().withId(2l).withName("t2").build()); ProcessInstanceDiagramSummary summary = new ProcessInstanceDiagramSummary(); summary.setProcessDefinition(ProcessSummary.builder().nodes(emptyList()).timers(emptyList()).build()); summary.setNodeInstances(emptyList()); summary.setTimerInstances(timerInstance); when(processService.getProcessInstanceDiagramSummary(eq(processInstance.getProcessInstanceKey()), anyString(), anyString(), anyString())).thenReturn(summary); presenter.setProcessInstance(processInstance); presenter.onTimerInstanceReschedule(timer); verify(processService).rescheduleTimerInstance(processInstance.getProcessInstanceKey(), timer); verify(notificationEvent).fire(any()); }