DatabaseStorageService implements StorageService { @SneakyThrows @Override public OutputStream write(WithCallback<AbsoluteLocation, ? extends ResourceWriteCallback> locationWithCallback) { ParsedLocation parsed = new ParsedLocation(locationWithCallback.getWrapped(), allowedTables); return new PutBlobOnClose( conn.jdbcTemplate(locationWithCallback.getWrapped()), parsed.getPathWithUser(), parsed.getTableName() ); }  @SneakyThrows @Override boolean objectExists(AbsoluteLocation location); @SneakyThrows @Override Stream<AbsoluteLocation<ResolvedResource>> list(AbsoluteLocation location); @SneakyThrows @Override InputStream read(AbsoluteLocation location); @SneakyThrows @Override void remove(AbsoluteLocation location); @SneakyThrows @Override OutputStream write(WithCallback<AbsoluteLocation, ? extends ResourceWriteCallback> locationWithCallback);  }
@Test @SneakyThrows void write() { writeData(OTHER_FILE, MESSAGE); try (InputStream read = storageService.read(OTHER_FILE)) { assertThat(read).hasContent(MESSAGE); } }