@Test public void getChannelIdentifiers() { MultiStepEvaluationFunction<GenericEvent> function = MultiStepEvaluationFunction.<GenericEvent>builder() .withErrorExtractor((ErrorExtractor<GenericEvent>) mock(ErrorExtractor.class)) .withEvaluationCompleteExtractor((EvaluationCompleteExtractor<GenericEvent>) mock(EvaluationCompleteExtractor.class)) .withOverallTimeoutMs(0L) .addEvaluationFunction(new LambdaEvaluationFunction<>( context -> {}, () -> new HashSet<>(Arrays.asList("1", "2", "3")) ), "step1") .addEvaluationFunction(new LambdaEvaluationFunction<>( context -> {}, () -> new HashSet<>(Arrays.asList("3", "4", "5")) ), "step2") .build(); List<String> channelIdentifiers = new ArrayList<>(function.getChannelIdentifiers()); assertEquals(5, channelIdentifiers.size()); assertTrue(channelIdentifiers.contains("1")); assertTrue(channelIdentifiers.contains("2")); assertTrue(channelIdentifiers.contains("3")); assertTrue(channelIdentifiers.contains("4")); assertTrue(channelIdentifiers.contains("5")); }
@Override public Set<String> getChannelIdentifiers() { final Set<String> result = new HashSet<>(); result.addAll(errorExtractor.getChannelIdentifiers()); result.addAll(stateCompleteExtractor.getChannelIdentifiers()); result.addAll( stateConfigs.stream() .flatMap( stateConfig -> stateConfig.getFactory().getChannelIdentifiers().stream()) .collect(Collectors.toSet()) ); return result; }
MultiStepEvaluationFunction implements EvaluationFunction<T> { @Override public Set<String> getChannelIdentifiers() { final Set<String> result = new HashSet<>(); result.addAll(errorExtractor.getChannelIdentifiers()); result.addAll(stateCompleteExtractor.getChannelIdentifiers()); result.addAll( stateConfigs.stream() .flatMap( stateConfig -> stateConfig.getFactory().getChannelIdentifiers().stream()) .collect(Collectors.toSet()) ); return result; } }
MultiStepEvaluationFunction implements EvaluationFunction<T> { @Override public Set<String> getChannelIdentifiers() { final Set<String> result = new HashSet<>(); result.addAll(errorExtractor.getChannelIdentifiers()); result.addAll(stateCompleteExtractor.getChannelIdentifiers()); result.addAll( stateConfigs.stream() .flatMap( stateConfig -> stateConfig.getFactory().getChannelIdentifiers().stream()) .collect(Collectors.toSet()) ); return result; } private  MultiStepEvaluationFunction(
            List<StateConfig<T>> stateConfigs,
            Long overallTimeoutMs,
            ErrorExtractor<T> errorExtractor,
            EvaluationCompleteExtractor<T> stateCompleteExtractor); }
MultiStepEvaluationFunction implements EvaluationFunction<T> { @Override public Set<String> getChannelIdentifiers() { final Set<String> result = new HashSet<>(); result.addAll(errorExtractor.getChannelIdentifiers()); result.addAll(stateCompleteExtractor.getChannelIdentifiers()); result.addAll( stateConfigs.stream() .flatMap( stateConfig -> stateConfig.getFactory().getChannelIdentifiers().stream()) .collect(Collectors.toSet()) ); return result; } private  MultiStepEvaluationFunction(
            List<StateConfig<T>> stateConfigs,
            Long overallTimeoutMs,
            ErrorExtractor<T> errorExtractor,
            EvaluationCompleteExtractor<T> stateCompleteExtractor); static Builder<T> builder(); @Override void eval(EvaluationContext context); @Override Set<String> getChannelIdentifiers(); }
MultiStepEvaluationFunction implements EvaluationFunction<T> { @Override public Set<String> getChannelIdentifiers() { final Set<String> result = new HashSet<>(); result.addAll(errorExtractor.getChannelIdentifiers()); result.addAll(stateCompleteExtractor.getChannelIdentifiers()); result.addAll( stateConfigs.stream() .flatMap( stateConfig -> stateConfig.getFactory().getChannelIdentifiers().stream()) .collect(Collectors.toSet()) ); return result; } private  MultiStepEvaluationFunction(
            List<StateConfig<T>> stateConfigs,
            Long overallTimeoutMs,
            ErrorExtractor<T> errorExtractor,
            EvaluationCompleteExtractor<T> stateCompleteExtractor); static Builder<T> builder(); @Override void eval(EvaluationContext context); @Override Set<String> getChannelIdentifiers();  }