summaryrefslogtreecommitdiffstats
path: root/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/ControllerSecuritySpec.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/ControllerSecuritySpec.groovy')
-rw-r--r--src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/ControllerSecuritySpec.groovy13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/ControllerSecuritySpec.groovy b/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/ControllerSecuritySpec.groovy
index 14ab7147..8b13fc79 100644
--- a/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/ControllerSecuritySpec.groovy
+++ b/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/ControllerSecuritySpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation
+ * Copyright (C) 2021-2022 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@
package org.onap.cps.ncmp.dmi.rest.controller
+import org.onap.cps.ncmp.dmi.config.WebSecurityConfig
+
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
import org.springframework.beans.factory.annotation.Autowired
@@ -60,4 +62,13 @@ class ControllerSecuritySpec extends Specification {
then: 'HTTP Unauthorized status code is returned'
assert response.status == HttpStatus.UNAUTHORIZED.value()
}
+
+ def 'Security Config #scenario permit URIs'() {
+ expect: 'can create a web security configuration'
+ new WebSecurityConfig(permitUris,'user','password')
+ where: 'the following string of permit URIs is provided'
+ scenario | permitUris
+ 'with' | 'a,b'
+ 'without' | ''
+ }
}