@@ -556,16 +556,17 @@ public void testCreateGroup() throws ZarrException, IOException {
556556
557557 Group group = Group .create (storeHandle , new GroupMetadata (attributes ));
558558 Assertions .assertTrue (storeHandle .resolve ("zarr.json" ).exists ());
559- Assertions .assertEquals ("world" , group .metadata .attributes .get ("hello" ));
559+ Assertions .assertEquals ("world" , group .metadata .attributes () .get ("hello" ));
560560
561561 group = Group .create (storeHandlePath , new GroupMetadata (attributes ));
562562 Assertions .assertTrue (Files .exists (storeHandlePath .resolve ("zarr.json" )));
563- Assertions .assertEquals ("world" , group .metadata .attributes .get ("hello" ));
563+ Assertions .assertEquals ("world" , group .metadata .attributes () .get ("hello" ));
564564
565565 group = Group .create (storeHandleString , new GroupMetadata (attributes ));
566566 Assertions .assertTrue (Files .exists (Paths .get (storeHandleString ).resolve ("zarr.json" )));
567- Assertions .assertEquals ("world" , group .metadata .attributes .get ("hello" ));
567+ Assertions .assertEquals ("world" , group .metadata .attributes () .get ("hello" ));
568568 }
569+
569570 @ Test
570571 public void testAttributes () throws IOException , ZarrException {
571572 StoreHandle storeHandle = new FilesystemStore (TESTOUTPUT ).resolve ("testAttributesV3" );
@@ -593,7 +594,6 @@ public void testAttributes() throws IOException, ZarrException {
593594 Assertions .assertEquals ("attribute" , arrayOpened .metadata ().attributes ().getString ("another" ));
594595 }
595596
596-
597597 @ Test
598598 public void testSetAndUpdateAttributes () throws IOException , ZarrException {
599599 StoreHandle storeHandle = new FilesystemStore (TESTOUTPUT ).resolve ("testSetAttributesV3" );
@@ -654,4 +654,18 @@ public void testResizeArray() throws IOException, ZarrException {
654654 Arrays .fill (expectedData , 1 );
655655 Assertions .assertArrayEquals (expectedData , (int []) data .get1DJavaArray (ma2DataType ));
656656 }
657+
658+ @ Test
659+ public void testGroupAttributes () throws IOException , ZarrException {
660+ StoreHandle storeHandle = new FilesystemStore (TESTOUTPUT ).resolve ("testGroupAttributesV3" );
661+
662+ Group group = Group .create (storeHandle , new Attributes () {{
663+ put ("group_attr" , "group_value" );
664+ }});
665+
666+ Assertions .assertEquals ("group_value" , group .metadata ().attributes ().getString ("group_attr" ));
667+
668+ group = Group .open (storeHandle );
669+ Assertions .assertEquals ("group_value" , group .metadata ().attributes ().getString ("group_attr" ));
670+ }
657671}
0 commit comments