@Test public void testInitialize() { List<FlowConfiguration<?>> flowConfigs = new ArrayList<>(); flowConfigs.add(new HelloWorldFlowConfig()); given(this.flowConfigs.stream()).willReturn(flowConfigs.stream()); underTest.init(); verify(reactor, times(1)).on(any(Selector.class), any(Consumer.class)); }
@PostConstruct public void init() { String eventSelector = Stream.concat(Stream.of(Flow2Handler.FLOW_FINAL, Flow2Handler.FLOW_CANCEL), flowConfigs.stream().flatMap(c -> Arrays.stream(c.getEvents())).map(FlowEvent::event) ).distinct().collect(Collectors.joining("|")); reactor.on(Selectors.regex(eventSelector), flow2Handler); }
Flow2Initializer { @PostConstruct public void init() { String eventSelector = Stream.concat(Stream.of(Flow2Handler.FLOW_FINAL, Flow2Handler.FLOW_CANCEL), flowConfigs.stream().flatMap(c -> Arrays.stream(c.getEvents())).map(FlowEvent::event) ).distinct().collect(Collectors.joining("|")); reactor.on(Selectors.regex(eventSelector), flow2Handler); } }
Flow2Initializer { @PostConstruct public void init() { String eventSelector = Stream.concat(Stream.of(Flow2Handler.FLOW_FINAL, Flow2Handler.FLOW_CANCEL), flowConfigs.stream().flatMap(c -> Arrays.stream(c.getEvents())).map(FlowEvent::event) ).distinct().collect(Collectors.joining("|")); reactor.on(Selectors.regex(eventSelector), flow2Handler); }  }
Flow2Initializer { @PostConstruct public void init() { String eventSelector = Stream.concat(Stream.of(Flow2Handler.FLOW_FINAL, Flow2Handler.FLOW_CANCEL), flowConfigs.stream().flatMap(c -> Arrays.stream(c.getEvents())).map(FlowEvent::event) ).distinct().collect(Collectors.joining("|")); reactor.on(Selectors.regex(eventSelector), flow2Handler); }  @PostConstruct void init(); }
Flow2Initializer { @PostConstruct public void init() { String eventSelector = Stream.concat(Stream.of(Flow2Handler.FLOW_FINAL, Flow2Handler.FLOW_CANCEL), flowConfigs.stream().flatMap(c -> Arrays.stream(c.getEvents())).map(FlowEvent::event) ).distinct().collect(Collectors.joining("|")); reactor.on(Selectors.regex(eventSelector), flow2Handler); }  @PostConstruct void init();  }