Skip to content

Commit

Permalink
another test for compression types
Browse files Browse the repository at this point in the history
Signed-off-by: Atanas Atanasov <[email protected]>
  • Loading branch information
ata-nas committed Dec 12, 2024
1 parent 628bea7 commit 4350670
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,34 @@ void testPersistenceStorageConfigInvalidCompressionLevel(final int compressionLe
"", "", StorageType.BLOCK_AS_LOCAL_FILE, CompressionType.ZSTD, compressionLevel));
}

/**
* This test aims to verify that the {@link PersistenceStorageConfig} class
* correctly returns the compression type that was set in the constructor.
*
* @param compressionType parameterized, the compression type to test
*/
@ParameterizedTest
@MethodSource("compressionTypes")
void testPersistenceStorageConfigCompressionTypes(final CompressionType compressionType) {
final PersistenceStorageConfig actual =
new PersistenceStorageConfig("", "", StorageType.NO_OP, compressionType, DEFAULT_COMPRESSION_LEVEL);
assertThat(actual).returns(compressionType, from(PersistenceStorageConfig::compression));
}

/**
* All storage types dynamically provided.
*/
private static Stream<Arguments> storageTypes() {
return Arrays.stream(StorageType.values()).map(Arguments::of);
}

/**
* All compression types dynamically provided.
*/
private static Stream<Arguments> compressionTypes() {
return Arrays.stream(CompressionType.values()).map(Arguments::of);
}

/**
* The default absolute paths. We expect these to allow the persistence
* config to be instantiated. Providing a blank string is accepted, it will
Expand Down

0 comments on commit 4350670

Please sign in to comment.