use of com.github.nagyesta.abortmission.core.MissionControl in project abort-mission by nagyesta.
the class LaunchAbortHook method findEvaluators.
private Set<MissionHealthCheckEvaluator> findEvaluators(final Scenario scenario) {
final Optional<String> context = scenario.getSourceTagNames().stream().filter(tag -> tag.startsWith("@AbortMission_Context_")).map(tag -> tag.replaceFirst("^@AbortMission_Context_", "")).findFirst();
final AbortMissionCommandOps commandOps = context.map(MissionControl::commandOps).orElse(MissionControl.commandOps());
return Objects.requireNonNull(commandOps, "Mission context is not found: " + context.orElse("'- DEFAULT - '")).matchingEvaluators(scenario);
}
Aggregations