@Test void startingForTheFirstTimeShouldSucceedWhenPassThrough() { StartUpCheck.CheckResult checkResult = testee.validate(BlobStoreConfiguration.builder().implementation(BlobStoreImplName.S3) .disableCache() .passthrough()); assertThat(checkResult.getResultType()).isEqualTo(StartUpCheck.ResultType.GOOD); }
public CheckResult validate(BlobStoreConfiguration blobStoreConfiguration) { return Mono.from(eventSourcingSystem.dispatch(new RegisterStorageStrategy(blobStoreConfiguration.storageStrategy()))) .thenReturn(CheckResult.builder() .checkName(CHECK) .resultType(StartUpCheck.ResultType.GOOD) .build()) .onErrorResume(IllegalStateException.class, e -> Mono.just(CheckResult.builder() .checkName(CHECK) .resultType(StartUpCheck.ResultType.BAD) .description(e.getMessage()) .build())) .block(); }
StorageStrategyValidationEventSourcingSystem { public CheckResult validate(BlobStoreConfiguration blobStoreConfiguration) { return Mono.from(eventSourcingSystem.dispatch(new RegisterStorageStrategy(blobStoreConfiguration.storageStrategy()))) .thenReturn(CheckResult.builder() .checkName(CHECK) .resultType(StartUpCheck.ResultType.GOOD) .build()) .onErrorResume(IllegalStateException.class, e -> Mono.just(CheckResult.builder() .checkName(CHECK) .resultType(StartUpCheck.ResultType.BAD) .description(e.getMessage()) .build())) .block(); } }
StorageStrategyValidationEventSourcingSystem { public CheckResult validate(BlobStoreConfiguration blobStoreConfiguration) { return Mono.from(eventSourcingSystem.dispatch(new RegisterStorageStrategy(blobStoreConfiguration.storageStrategy()))) .thenReturn(CheckResult.builder() .checkName(CHECK) .resultType(StartUpCheck.ResultType.GOOD) .build()) .onErrorResume(IllegalStateException.class, e -> Mono.just(CheckResult.builder() .checkName(CHECK) .resultType(StartUpCheck.ResultType.BAD) .description(e.getMessage()) .build())) .block(); } @Inject  StorageStrategyValidationEventSourcingSystem(EventStore eventStore); }
StorageStrategyValidationEventSourcingSystem { public CheckResult validate(BlobStoreConfiguration blobStoreConfiguration) { return Mono.from(eventSourcingSystem.dispatch(new RegisterStorageStrategy(blobStoreConfiguration.storageStrategy()))) .thenReturn(CheckResult.builder() .checkName(CHECK) .resultType(StartUpCheck.ResultType.GOOD) .build()) .onErrorResume(IllegalStateException.class, e -> Mono.just(CheckResult.builder() .checkName(CHECK) .resultType(StartUpCheck.ResultType.BAD) .description(e.getMessage()) .build())) .block(); } @Inject  StorageStrategyValidationEventSourcingSystem(EventStore eventStore); CheckResult validate(BlobStoreConfiguration blobStoreConfiguration); }
StorageStrategyValidationEventSourcingSystem { public CheckResult validate(BlobStoreConfiguration blobStoreConfiguration) { return Mono.from(eventSourcingSystem.dispatch(new RegisterStorageStrategy(blobStoreConfiguration.storageStrategy()))) .thenReturn(CheckResult.builder() .checkName(CHECK) .resultType(StartUpCheck.ResultType.GOOD) .build()) .onErrorResume(IllegalStateException.class, e -> Mono.just(CheckResult.builder() .checkName(CHECK) .resultType(StartUpCheck.ResultType.BAD) .description(e.getMessage()) .build())) .block(); } @Inject  StorageStrategyValidationEventSourcingSystem(EventStore eventStore); CheckResult validate(BlobStoreConfiguration blobStoreConfiguration); static final String CHECK; }