- def 'Delete schema set with cascade allowed.'() {
- when: 'a schema set is deleted with cascade-allowed option'
- objectUnderTest.deleteSchemaSet(DATASPACE_NAME, SCHEMA_SET_NAME_WITH_ANCHORS_AND_DATA,
- CASCADE_DELETE_ALLOWED)
- then: 'the schema set has been deleted'
- schemaSetRepository
- .findByDataspaceAndName(dataspaceEntity, SCHEMA_SET_NAME_WITH_ANCHORS_AND_DATA).isPresent() == false
- and: 'the associated anchors are removed'
- def associatedAnchorsIds = [ 6001, 6002 ]
- associatedAnchorsIds.each {anchorRepository.findById(it).isPresent() == false }
- and: 'the fragment(s) under those anchors are removed'
- def fragmentUnderAnchor1Id = 7001L
- fragmentRepository.findById(fragmentUnderAnchor1Id).isPresent() == false
- and: 'the shared resources still persist'
- def sharedResourceIds = [ 3003L, 3004L ]
- sharedResourceIds.each {yangResourceRepository.findById(it).isPresent() }
+ def 'Identifying new module references where #scenario'() {
+ when: 'identifyNewModuleReferences is called'
+ def result = objectUnderTest.identifyNewModuleReferences(moduleReferences)
+ then: 'the correct module reference collection is returned'
+ assert result == expectedResult
+ where: 'the following data is used'
+ scenario | moduleReferences || expectedResult
+ 'new module references exist' | toModuleReference([['some module 1' : 'some revision 1'], ['some module 2' : 'some revision 2']]) || toModuleReference([['some module 1' : 'some revision 1'], ['some module 2' : 'some revision 2']])
+ 'no new module references exist' | [] || []
+ 'module references collection is null'| null || []