diff --git a/src/test/java/org/janelia/saalfeldlab/n5/zarr/N5ZarrTest.java b/src/test/java/org/janelia/saalfeldlab/n5/zarr/N5ZarrTest.java index cd0f74b..22ecc03 100644 --- a/src/test/java/org/janelia/saalfeldlab/n5/zarr/N5ZarrTest.java +++ b/src/test/java/org/janelia/saalfeldlab/n5/zarr/N5ZarrTest.java @@ -687,6 +687,7 @@ public void testReadZarrNestedPython() throws IOException, InterruptedException @Test public void testRawCompressorNullInZarray() throws IOException, ParseException, URISyntaxException { + // GsonBuilder's default value for serializeNulls is false final ZarrKeyValueWriter n5 = (ZarrKeyValueWriter) createTempN5Writer(); n5.createDataset( testZarrDatasetName, @@ -704,6 +705,27 @@ public void testRawCompressorNullInZarray() throws IOException, ParseException, } } + @Test + public void testFiltersNullInZarray() throws IOException, ParseException, URISyntaxException { + + // GsonBuilder's default value for serializeNulls is false + final ZarrKeyValueWriter n5 = (ZarrKeyValueWriter)createTempN5Writer(); + n5.createDataset( + testZarrDatasetName, + new long[]{1, 2, 3}, + new int[]{1, 2, 3}, + DataType.UINT16, + new RawCompression()); + final String zarrayLocation = n5.keyValueAccess.compose(n5.uri, testZarrDatasetName, ".zarray"); + final LockedChannel zarrayChannel = n5.keyValueAccess.lockForReading(zarrayLocation); + final JSONParser jsonParser = new JSONParser(); + try (Reader reader = zarrayChannel.newReader()) { + final JSONObject zarray = (JSONObject)jsonParser.parse(reader); + final JSONObject filters = (JSONObject)zarray.get("filters"); + assertNull(filters); + } + } + @Test @Override public void testAttributes() {