use of org.apache.cassandra.io.util.FileOutputStreamPlus in project cassandra by apache.
the class SnapshotManifestTest method testOptionalFields.
@Test
public void testOptionalFields() throws IOException {
Map<String, Object> map = new HashMap<>();
map.put("files", Arrays.asList("db1", "db2", "db3"));
ObjectMapper mapper = new ObjectMapper();
File manifestFile = new File(tempFolder.newFile("manifest.json"));
mapper.writeValue((OutputStream) new FileOutputStreamPlus(manifestFile), map);
SnapshotManifest manifest = SnapshotManifest.deserializeFromJsonFile(manifestFile);
assertThat(manifest.getExpiresAt()).isNull();
assertThat(manifest.getCreatedAt()).isNull();
assertThat(manifest.getFiles()).contains("db1").contains("db2").contains("db3").hasSize(3);
}
Aggregations