public ConditionEvaluationResult eval(Duration pollInterval) throws Exception { lastResult = supplier.call(); boolean matches = matcher.matches(lastResult); if (matches) { conditionEvaluationHandler.handleConditionResultMatch(getMatchMessage(supplier, matcher), lastResult, pollInterval); } else { conditionEvaluationHandler.handleConditionResultMismatch(getMismatchMessage(supplier, matcher), lastResult, pollInterval); } return new ConditionEvaluationResult(matches); } };
public ConditionEvaluationResult eval(Duration pollInterval) throws Exception { boolean conditionFulfilled = matcher.call(); if (conditionFulfilled) { conditionEvaluationHandler.handleConditionResultMatch(getMatchMessage(matcher, settings.getAlias()), true, pollInterval); } else { conditionEvaluationHandler.handleConditionResultMismatch(getMismatchMessage(matcher, settings.getAlias()), false, pollInterval); } return new ConditionEvaluationResult(conditionFulfilled); }
public ConditionEvaluationResult eval(Duration pollInterval) throws Exception { try { supplier.run(); conditionEvaluationHandler.handleConditionResultMatch(getMatchMessage(supplier, settings.getAlias()), null, pollInterval); return new ConditionEvaluationResult(true); } catch (AssertionError e) { lastExceptionMessage = e.getMessage(); conditionEvaluationHandler.handleConditionResultMismatch(getMismatchMessage(supplier, lastExceptionMessage, settings.getAlias(), true), null, pollInterval); return new ConditionEvaluationResult(false, null, e); } catch (Throwable throwable) { return CheckedExceptionRethrower.safeRethrow(throwable); } } };
public ConditionEvaluationResult eval(Duration pollInterval) throws Exception { lastResult = supplier.call(); boolean matches = matcher.matches(lastResult); if (matches) { conditionEvaluationHandler.handleConditionResultMatch(getMatchMessage(supplier, matcher), lastResult, pollInterval); } else { conditionEvaluationHandler.handleConditionResultMismatch(getMismatchMessage(supplier, matcher), lastResult, pollInterval); } return new ConditionEvaluationResult(matches); } };
public ConditionEvaluationResult eval(Duration pollInterval) throws Exception { boolean conditionFulfilled = matcher.call(); if (conditionFulfilled) { conditionEvaluationHandler.handleConditionResultMatch(getMatchMessage(matcher, settings.getAlias()), true, pollInterval); } else { conditionEvaluationHandler.handleConditionResultMismatch(getMismatchMessage(matcher, settings.getAlias()), false, pollInterval); } return new ConditionEvaluationResult(conditionFulfilled); }
public ConditionEvaluationResult eval(Duration pollInterval) throws Exception { try { supplier.run(); conditionEvaluationHandler.handleConditionResultMatch(getMatchMessage(supplier, settings.getAlias()), null, pollInterval); return new ConditionEvaluationResult(true); } catch (AssertionError e) { lastExceptionMessage = e.getMessage(); conditionEvaluationHandler.handleConditionResultMismatch(getMismatchMessage(supplier, lastExceptionMessage, settings.getAlias(), true), null, pollInterval); return new ConditionEvaluationResult(false, null, e); } catch (Throwable throwable) { return CheckedExceptionRethrower.safeRethrow(throwable); } } };