Sha256ChecksumProvider implements ChecksumProvider { @Override public Mono<String> checksum(final byte[] documentContents) { return Mono.fromSupplier(() -> DigestUtils.sha256Hex(documentContents)); }  @Override Mono<String> checksum(final byte[] documentContents);  }
@Test void testChecksum() throws URISyntaxException, IOException { final Path checksumTestFile = Path.of(Objects.requireNonNull(Thread.currentThread().getContextClassLoader() .getResource("checksum_test.txt")).toURI()); final Mono<String> result = sha256ChecksumProvider.checksum( Files.newInputStream(checksumTestFile).readAllBytes()); StepVerifier.create(result) .assertNext(resultValue -> assertThat(resultValue, is( "5be0888bbe2087f962fee5748d9cf52e37e4c6a24af79675ff7e1ca0a1b12739"))) .verifyComplete(); }