- def 'Get request without authentication is not authorized'() {
- when: 'request is sent without authentication'
- def response =
- mvc.perform(get("$basePath/v1/dataspaces/dataspace-name/anchors")).andReturn().response
- then: 'HTTP Unauthorized status code is returned'
- assert UNAUTHORIZED.value() == response.status
- }
-
- def 'Get request with invalid authentication is not authorized'() {
- when: 'request is sent with invalid authentication'
- def response =
- mvc.perform(
- get("$basePath/v1/dataspaces/dataspace-name/anchors")
- .header("Authorization", 'Basic invalid auth'))
- .andReturn().response
- then: 'HTTP Unauthorized status code is returned'
- assert UNAUTHORIZED.value() == response.status
- }
-