From b130fd3158c537df1ce2cb1e5a7a86c3d7e0d2a7 Mon Sep 17 00:00:00 2001 From: DylanB95EST Date: Mon, 4 Apr 2022 13:09:22 +0100 Subject: Refactoring/ Adding Tests for Validation Refactored classes affected by validation Have added tests for anywhere where validation is used Have refactored the parse and sync modules validation to be validated at the public api method Issue-ID: CPS-322 Change-Id: I4989cfd03300fbdca41571d0aa2d0b96978858ba Signed-off-by: DylanB95EST --- .../org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cps-ri') diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy index f486cb76d0..2de087fc28 100644 --- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy +++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy @@ -53,7 +53,7 @@ class CpsAdminPersistenceServiceSpec extends CpsPersistenceSpecBase { @Sql(CLEAR_DATA) def 'Create and retrieve a new dataspace.'() { when: 'a new dataspace is created' - def dataspaceName = 'some new dataspace' + def dataspaceName = 'some-new-dataspace' objectUnderTest.createDataspace(dataspaceName) then: 'that dataspace can be retrieved from the dataspace repository' def dataspaceEntity = dataspaceRepository.findByName(dataspaceName).orElseThrow() @@ -73,7 +73,7 @@ class CpsAdminPersistenceServiceSpec extends CpsPersistenceSpecBase { @Sql([CLEAR_DATA, SET_DATA]) def 'Create and retrieve a new anchor.'() { when: 'a new anchor is created' - def newAnchorName = 'my new anchor' + def newAnchorName = 'my-new-anchor' objectUnderTest.createAnchor(DATASPACE_NAME, SCHEMA_SET_NAME1, newAnchorName) then: 'that anchor can be retrieved' def anchor = objectUnderTest.getAnchor(DATASPACE_NAME, newAnchorName) @@ -148,7 +148,7 @@ class CpsAdminPersistenceServiceSpec extends CpsPersistenceSpecBase { @Sql(CLEAR_DATA) def 'Get all anchors in unknown dataspace.'() { when: 'attempt to get all anchors in an unknown dataspace' - objectUnderTest.getAnchors('unknown dataspace') + objectUnderTest.getAnchors('unknown-dataspace') then: 'an DataspaceNotFoundException is thrown' thrown(DataspaceNotFoundException) } -- cgit 1.2.3-korg