@Test public void testAccepted() throws InterruptedException { Stack stack = TestUtil.stack(); stack.setCluster(TestUtil.cluster()); stack.getCluster().setStatus(Status.AVAILABLE); when(stackService.getByIdWithTransaction(1L)).thenReturn(stack); Acceptable data = mock(Acceptable.class); Promise<AcceptResult> accepted = (Promise<AcceptResult>) mock(Promise.class); when(data.accepted()).thenReturn(accepted); when(data.getResourceId()).thenReturn(1L); Event<Acceptable> event = new Event<>(data); when(eventFactory.createEventWithErrHandler(anyMap(), any(Acceptable.class))) .thenReturn(event); FlowAcceptResult acceptResult = FlowAcceptResult.runningInFlow("flowid"); when(accepted.await(10L, TimeUnit.SECONDS)).thenReturn(acceptResult); underTest.notify(1L, "RANDOM", data, stackService::getByIdWithTransaction); verify(reactorReporter, times(1)).logInfoReport(); verify(reactor, times(1)).notify(eq("RANDOM"), eq(event)); verify(accepted, times(1)).await(10L, TimeUnit.SECONDS); }
public FlowIdentifier notify(Long stackId, String selector, Acceptable acceptable) { return notify(stackId, selector, acceptable, stackService::getByIdWithTransaction); }
ReactorNotifier { public FlowIdentifier notify(Long stackId, String selector, Acceptable acceptable) { return notify(stackId, selector, acceptable, stackService::getByIdWithTransaction); } }
ReactorNotifier { public FlowIdentifier notify(Long stackId, String selector, Acceptable acceptable) { return notify(stackId, selector, acceptable, stackService::getByIdWithTransaction); }  }
ReactorNotifier { public FlowIdentifier notify(Long stackId, String selector, Acceptable acceptable) { return notify(stackId, selector, acceptable, stackService::getByIdWithTransaction); }  FlowIdentifier notify(Long stackId, String selector, Acceptable acceptable); FlowIdentifier notifyWithoutCheck(Long stackId, String selector, Acceptable acceptable); FlowIdentifier notify(BaseFlowEvent selectable, Event.Headers headers); FlowIdentifier notify(Long stackId, String selector, Acceptable acceptable, Function<Long, Stack> getStackFn); }
ReactorNotifier { public FlowIdentifier notify(Long stackId, String selector, Acceptable acceptable) { return notify(stackId, selector, acceptable, stackService::getByIdWithTransaction); }  FlowIdentifier notify(Long stackId, String selector, Acceptable acceptable); FlowIdentifier notifyWithoutCheck(Long stackId, String selector, Acceptable acceptable); FlowIdentifier notify(BaseFlowEvent selectable, Event.Headers headers); FlowIdentifier notify(Long stackId, String selector, Acceptable acceptable, Function<Long, Stack> getStackFn);  }