Search in sources :

Example 1 with MissionControl

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);
}
Also used : MissionOutline(com.github.nagyesta.abortmission.core.outline.MissionOutline) MissionHealthCheckEvaluator(com.github.nagyesta.abortmission.core.healthcheck.MissionHealthCheckEvaluator) java.util(java.util) AbortMissionCommandOps(com.github.nagyesta.abortmission.core.AbortMissionCommandOps) Logger(org.slf4j.Logger) Result(io.cucumber.plugin.event.Result) Scenario(io.cucumber.java.Scenario) LoggerFactory(org.slf4j.LoggerFactory) Status(io.cucumber.plugin.event.Status) ScenarioUriMatcher(com.github.nagyesta.abortmission.booster.cucumber.matcher.ScenarioUriMatcher) Field(java.lang.reflect.Field) StageTimeStopwatch(com.github.nagyesta.abortmission.core.telemetry.watch.StageTimeStopwatch) Consumer(java.util.function.Consumer) MissionControl(com.github.nagyesta.abortmission.core.MissionControl) MissionHealthCheckMatcher(com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher) ScenarioNameMatcher(com.github.nagyesta.abortmission.booster.cucumber.matcher.ScenarioNameMatcher) AbortMissionCommandOps(com.github.nagyesta.abortmission.core.AbortMissionCommandOps)

Aggregations

ScenarioNameMatcher (com.github.nagyesta.abortmission.booster.cucumber.matcher.ScenarioNameMatcher)1 ScenarioUriMatcher (com.github.nagyesta.abortmission.booster.cucumber.matcher.ScenarioUriMatcher)1 AbortMissionCommandOps (com.github.nagyesta.abortmission.core.AbortMissionCommandOps)1 MissionControl (com.github.nagyesta.abortmission.core.MissionControl)1 MissionHealthCheckEvaluator (com.github.nagyesta.abortmission.core.healthcheck.MissionHealthCheckEvaluator)1 MissionHealthCheckMatcher (com.github.nagyesta.abortmission.core.matcher.MissionHealthCheckMatcher)1 MissionOutline (com.github.nagyesta.abortmission.core.outline.MissionOutline)1 StageTimeStopwatch (com.github.nagyesta.abortmission.core.telemetry.watch.StageTimeStopwatch)1 Scenario (io.cucumber.java.Scenario)1 Result (io.cucumber.plugin.event.Result)1 Status (io.cucumber.plugin.event.Status)1 Field (java.lang.reflect.Field)1 java.util (java.util)1 Consumer (java.util.function.Consumer)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1