X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-ncmp-service%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fncmp%2Fapi%2Fimpl%2FNetworkCmProxyDataServiceImplSpec.groovy;h=9c79d4fcf1743de27fc3ce6f86751e41dd82977b;hb=e0873dde9816543a34818c1509b1aaa1c195a875;hp=7f127003d20044d54812da71301ba18d9a9602a4;hpb=63132cec2c18363a8224646039cc23b6144d8e6c;p=cps.git diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy index 7f127003d..9c79d4fcf 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy @@ -35,7 +35,7 @@ import com.fasterxml.jackson.databind.ObjectMapper import org.onap.cps.api.CpsAdminService import org.onap.cps.api.CpsDataService import org.onap.cps.api.CpsModuleService -import org.onap.cps.ncmp.api.impl.exception.NcmpException +import org.onap.cps.ncmp.api.impl.exception.ServerNcmpException import org.onap.cps.ncmp.api.impl.operations.DmiDataOperations import org.onap.cps.spi.FetchDescendantsOption import org.onap.cps.spi.model.DataNode @@ -88,12 +88,11 @@ class NetworkCmProxyDataServiceImplSpec extends Specification { 'testResourceId', CREATE, '{some-json}', 'application/json') then: 'exception is thrown' - def exceptionThrown = thrown(NcmpException.class) + def exceptionThrown = thrown(ServerNcmpException.class) and: 'details contains (not found) error code: 404' exceptionThrown.details.contains('404') } - def 'Get resource data for pass-through operational from DMI.'() { given: 'get data node is called' mockCpsDataService.getDataNode('NCMP-Admin', 'ncmp-dmi-registry', @@ -129,7 +128,7 @@ class NetworkCmProxyDataServiceImplSpec extends Specification { 'testAcceptParam', '(a=1,b=2)') then: 'exception is thrown with the expected details' - def exceptionThrown = thrown(NcmpException.class) + def exceptionThrown = thrown(ServerNcmpException.class) exceptionThrown.details == 'DMI status code: 404, DMI response body: NOK-json' } @@ -150,7 +149,7 @@ class NetworkCmProxyDataServiceImplSpec extends Specification { 'testAcceptParam', '(a=1,b=2)') then: 'exception is thrown' - def exceptionThrown = thrown(NcmpException.class) + def exceptionThrown = thrown(ServerNcmpException.class) and: 'details contains the original response' exceptionThrown.details.contains('NOK-json') } @@ -191,7 +190,7 @@ class NetworkCmProxyDataServiceImplSpec extends Specification { 'testAcceptParam', '(a=1,b=2)') then: 'exception is thrown' - def exceptionThrown = thrown(NcmpException.class) + def exceptionThrown = thrown(ServerNcmpException.class) and: 'details contains the original response' exceptionThrown.details.contains('NOK-json') } @@ -236,7 +235,7 @@ class NetworkCmProxyDataServiceImplSpec extends Specification { '{some-json}', 'application/json') then: 'an exception is thrown with the expected error message detailsd with correct operation' - def exceptionThrown = thrown(NcmpException.class) + def exceptionThrown = thrown(ServerNcmpException.class) exceptionThrown.getMessage().contains(expectedResponseMessage) where: scenario | givenOperation || expectedResponseMessage