@Test void performCheckShouldNotPropagateUnExpectedExceptionDuringChecking() { String checkName = "throwing check name"; StartUpChecksPerformer checksPerformer = StartUpChecksPerformer.from( new StartUpCheck() { @Override public CheckResult check() { throw new RuntimeException("unexpected"); } @Override public String checkName() { return checkName; } }); assertThatThrownBy(checksPerformer::performCheck) .isInstanceOfSatisfying( StartUpChecksPerformer.StartUpChecksException.class, exception -> assertThat(exception.badCheckNames()) .containsOnly(checkName)); }
@VisibleForTesting static StartUpChecksPerformer from(StartUpCheck... checks) { return new StartUpChecksPerformer(new StartUpChecks(Sets.newHashSet(checks))); }
StartUpChecksPerformer { @VisibleForTesting static StartUpChecksPerformer from(StartUpCheck... checks) { return new StartUpChecksPerformer(new StartUpChecks(Sets.newHashSet(checks))); } }
StartUpChecksPerformer { @VisibleForTesting static StartUpChecksPerformer from(StartUpCheck... checks) { return new StartUpChecksPerformer(new StartUpChecks(Sets.newHashSet(checks))); } @Inject  StartUpChecksPerformer(StartUpChecks startUpChecks); }
StartUpChecksPerformer { @VisibleForTesting static StartUpChecksPerformer from(StartUpCheck... checks) { return new StartUpChecksPerformer(new StartUpChecks(Sets.newHashSet(checks))); } @Inject  StartUpChecksPerformer(StartUpChecks startUpChecks); void performCheck(); }
StartUpChecksPerformer { @VisibleForTesting static StartUpChecksPerformer from(StartUpCheck... checks) { return new StartUpChecksPerformer(new StartUpChecks(Sets.newHashSet(checks))); } @Inject  StartUpChecksPerformer(StartUpChecks startUpChecks); void performCheck();  }