File tree Expand file tree Collapse file tree
src/test/java/edu/kit/datamanager/ro_crate Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,6 +261,8 @@ void testReadKeys() {
261261 for (String key : expected ) {
262262 assertTrue (given .contains (key ), "Key " + key + " not found in the context" );
263263 }
264+ // prove immutability
265+ assertThrows (UnsupportedOperationException .class , () -> given .add ("newKey" ));
264266 }
265267
266268 @ Test
@@ -273,5 +275,7 @@ void testReadPairs() {
273275 assertTrue (keys .contains (key ), "Key " + key + " not found in the context" );
274276 values .forEach (s -> assertFalse (s .isEmpty (), "Value for key " + key + " is empty" ));
275277 }
278+ // prove immutability
279+ assertThrows (UnsupportedOperationException .class , () -> given .put ("newKey" , "newValue" ));
276280 }
277281}
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ void testReadContextKeys() {
6262 for (String key : expected ) {
6363 assertTrue (given .contains (key ), "Key " + key + " not found in the context" );
6464 }
65+ // prove immutability
66+ assertThrows (UnsupportedOperationException .class , () -> given .add ("newKey" ));
6567 }
6668
6769 @ Test
@@ -74,5 +76,7 @@ void testReadContextPairs() {
7476 assertTrue (keys .contains (key ), "Key " + key + " not found in the context" );
7577 values .forEach (s -> assertFalse (s .isEmpty (), "Value for key " + key + " is empty" ));
7678 }
79+ // prove immutability
80+ assertThrows (UnsupportedOperationException .class , () -> given .put ("newKey" , "newValue" ));
7781 }
7882}
You can’t perform that action at this time.
0 commit comments