Code Review
/
cps.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[TECHDEBT] Align CPS NCMP REST API Specification
[cps.git]
/
cps-ncmp-service
/
src
/
test
/
groovy
/
org
/
onap
/
cps
/
ncmp
/
api
/
impl
/
NetworkCmProxyDataServiceImplSpec.groovy
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
7f12700
..
9c79d4f
100644
(file)
--- 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.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.
Server
NcmpException
import org.onap.cps.ncmp.api.impl.operations.DmiDataOperations
import org.onap.cps.spi.FetchDescendantsOption
import org.onap.cps.spi.model.DataNode
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'
'testResourceId', CREATE,
'{some-json}', 'application/json')
then: 'exception is thrown'
- def exceptionThrown = thrown(NcmpException.class)
+ def exceptionThrown = thrown(
Server
NcmpException.class)
and: 'details contains (not found) error code: 404'
exceptionThrown.details.contains('404')
}
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',
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'
'testAcceptParam',
'(a=1,b=2)')
then: 'exception is thrown with the expected details'
- def exceptionThrown = thrown(NcmpException.class)
+ def exceptionThrown = thrown(
Server
NcmpException.class)
exceptionThrown.details == 'DMI status code: 404, DMI response body: NOK-json'
}
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'
'testAcceptParam',
'(a=1,b=2)')
then: 'exception is thrown'
- def exceptionThrown = thrown(NcmpException.class)
+ def exceptionThrown = thrown(
Server
NcmpException.class)
and: 'details contains the original response'
exceptionThrown.details.contains('NOK-json')
}
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'
'testAcceptParam',
'(a=1,b=2)')
then: 'exception is thrown'
- def exceptionThrown = thrown(NcmpException.class)
+ def exceptionThrown = thrown(
Server
NcmpException.class)
and: 'details contains the original response'
exceptionThrown.details.contains('NOK-json')
}
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'
'{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(
Server
NcmpException.class)
exceptionThrown.getMessage().contains(expectedResponseMessage)
where:
scenario | givenOperation || expectedResponseMessage
exceptionThrown.getMessage().contains(expectedResponseMessage)
where:
scenario | givenOperation || expectedResponseMessage