+ @Sql([CLEAR_DATA, SET_DATA])
+ def 'Get all anchors associated with schemaset in a dataspace.'() {
+ when: 'anchors are retrieved by dataspace and schema-set'
+ def anchors = objectUnderTest.getAnchors(dataspace, schemasetName)
+ then: ' the response contains expected anchors'
+ anchors == expectedAnchors
+ where:
+ scenario | dataspace | schemasetName || expectedAnchors
+ 'no-anchors' | 'DATASPACE-003' | 'SCHEMA-SET-002-NO-ANCHORS' || Collections.emptySet()
+ 'one-anchor' | 'DATASPACE-001' | 'SCHEMA-SET-001' || Set.of(new Anchor('ANCHOR-001', 'DATASPACE-001', 'SCHEMA-SET-001'))
+ }
+
+ @Sql([CLEAR_DATA, SET_DATA])
+ def 'Error Handling: Get all anchors associated with schemaset in a dataspace.'() {
+ when: 'anchors are retrieved by dataspace and schema-set'
+ def anchors = objectUnderTest.getAnchors(dataspace, schemasetName)
+ then: ' an expected expception is thrown'
+ thrown(expectedException)
+ where:
+ scenario | dataspace | schemasetName || expectedException
+ 'unknown-dataspace' | 'unknown' | 'SCHEMA-SET-002-NO-ANCHORS' || DataspaceNotFoundException
+ 'unknown-schemaset' | 'DATASPACE-001' | 'unknown-schema-set' || SchemaSetNotFoundException
+ }
+