summaryrefslogtreecommitdiffstats
path: root/cps-rest/src/test/groovy/org
diff options
context:
space:
mode:
authorToineSiebelink <toine.siebelink@est.tech>2023-01-19 16:45:58 +0000
committerToineSiebelink <toine.siebelink@est.tech>2023-01-31 11:26:22 +0000
commit0fa2fabeec18763bab060d85f5123bceff8ee34c (patch)
tree3fc7b6bcd8344b8841b397a85beb01a20f9f34b0 /cps-rest/src/test/groovy/org
parent3d878b0674cd61e64501dfe6564b8921e76056bb (diff)
Introduce Instrumentation
- Add instrumentation related dependency - Added Timed Instrumentation - CPS-Service Crud methods - CPS Yang parsing - NCMP Registration methods - NCMP Events handling - Remove manual Gauge for YanResources Cache as (better!) instrumentation is already built into the 3PP - Sorted dependecies alphabetically (as we used to enforce, to prevent duplicates) - Added ## P E R F O R M A N C E T E S T R E S U L T S ### mini report - (unrelated) test improvement (because of bug that turned out to be invalid) Reviewers: Sourabh,Priyank, Luke Issue-ID: CPS-1457 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I34b20bece2f59488b022b8effa9470704c57be4d
Diffstat (limited to 'cps-rest/src/test/groovy/org')
-rw-r--r--cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy14
1 files changed, 12 insertions, 2 deletions
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
index 0821b6bebc..535b83df76 100644
--- a/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
+++ b/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
@@ -1,7 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Pantheon.tech
- * Modifications Copyright (C) 2021-2022 Nordix Foundation
+ * Modifications Copyright (C) 2021-2023 Nordix Foundation
* Modifications Copyright (C) 2021 Bell Canada.
* Modifications Copyright (C) 2022 TechMahindra Ltd.
* Modifications Copyright (C) 2022 Deutsche Telekom AG
@@ -136,8 +136,18 @@ class CpsRestExceptionHandlerSpec extends Specification {
"Anchor with name ${existingObjectName} already exists for ${dataspaceName}.")
}
+ def 'Request with a schema set in use exception returns HTTP Status Conflict.'() {
+ when: 'Schema set in use exception is thrown by the service'
+ setupTestException(new SchemaSetInUseException(dataspaceName, existingObjectName))
+ def response = performTestRequest()
+ then: 'a HTTP conflict response is returned with correct message an details'
+ assertTestResponse(response, CONFLICT,
+ "Schema Set is being used.",
+ "Schema Set with name ${existingObjectName} in dataspace ${dataspaceName} is having Anchor records associated.")
+ }
+
def 'Get request with a #exceptionThrown.class.simpleName returns HTTP Status Bad Request'() {
- when: 'CPS validation exception is thrown by the service'
+ when: '#exceptionThrown.class.simpleName is thrown by the service'
setupTestException(exceptionThrown)
def response = performTestRequest()
then: 'an HTTP Bad Request response is returned with correct message and details'