[TECHDEBT] Align CPS NCMP REST API Specification
[cps.git] / cps-ncmp-service / src / test / groovy / org / onap / cps / ncmp / api / impl / NetworkCmProxyDataServiceImplSpec.groovy
index 7f12700..9c79d4f 100644 (file)
@@ -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