@Test void degradedShouldThrowWhenNullCause() { assertThatThrownBy(() -> Result.degraded(COMPONENT_NAME, null)) .isInstanceOf(NullPointerException.class); }
public static Result degraded(ComponentName componentName, String cause) { return new Result(componentName, ResultStatus.DEGRADED, Optional.of(cause), Optional.empty()); }
Result { public static Result degraded(ComponentName componentName, String cause) { return new Result(componentName, ResultStatus.DEGRADED, Optional.of(cause), Optional.empty()); } }
Result { public static Result degraded(ComponentName componentName, String cause) { return new Result(componentName, ResultStatus.DEGRADED, Optional.of(cause), Optional.empty()); } private  Result(ComponentName componentName, ResultStatus status, Optional<String> cause, Optional<Throwable> error); }
Result { public static Result degraded(ComponentName componentName, String cause) { return new Result(componentName, ResultStatus.DEGRADED, Optional.of(cause), Optional.empty()); } private  Result(ComponentName componentName, ResultStatus status, Optional<String> cause, Optional<Throwable> error); static Result healthy(ComponentName componentName); static Result unhealthy(ComponentName componentName, String cause); static Result unhealthy(ComponentName componentName, String cause, Throwable error); static Result degraded(ComponentName componentName, String cause); ComponentName getComponentName(); ResultStatus getStatus(); Optional<String> getCause(); Optional<Throwable> getError(); boolean isHealthy(); boolean isDegraded(); boolean isUnHealthy(); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString(); }
Result { public static Result degraded(ComponentName componentName, String cause) { return new Result(componentName, ResultStatus.DEGRADED, Optional.of(cause), Optional.empty()); } private  Result(ComponentName componentName, ResultStatus status, Optional<String> cause, Optional<Throwable> error); static Result healthy(ComponentName componentName); static Result unhealthy(ComponentName componentName, String cause); static Result unhealthy(ComponentName componentName, String cause, Throwable error); static Result degraded(ComponentName componentName, String cause); ComponentName getComponentName(); ResultStatus getStatus(); Optional<String> getCause(); Optional<Throwable> getError(); boolean isHealthy(); boolean isDegraded(); boolean isUnHealthy(); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString();  }