From a0da7f6b3e04ee6f06f4580f8a14e60f3438d5e7 Mon Sep 17 00:00:00 2001 From: niamhcore Date: Fri, 11 Dec 2020 12:37:35 +0000 Subject: Remove depredcated code/classes Issue-ID: CPS-93 Signed-off-by: niamhcore Change-Id: I49db5244400d5eb4206d59e73aaf801b7f90c61c --- .../cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cps-rest/src/test') 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 d951cbeb6..e427c6063 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 @@ -20,7 +20,7 @@ package org.onap.cps.rest.exceptions import groovy.json.JsonSlurper -import org.onap.cps.api.CpService +import org.onap.cps.api.CpsAdminService import org.onap.cps.spi.exceptions.AnchorAlreadyDefinedException import org.onap.cps.spi.exceptions.CpsException import org.onap.cps.spi.exceptions.DataValidationException @@ -50,12 +50,12 @@ class CpsRestExceptionHandlerSpec extends Specification { def existingObjectName = 'MyAdminObject' def cpsRestController = new CpsRestController() - def mockCpService = Mock(CpService.class) + def mockCpsAdminService = Mock(CpsAdminService.class) def objectUnderTest = new CpsRestExceptionHandler() def mockMvc = standaloneSetup(cpsRestController).setControllerAdvice(objectUnderTest).build() def setup() { - cpsRestController.cpService = mockCpService + cpsRestController.cpsAdminService = mockCpsAdminService } def 'Get request with runtime exception returns HTTP Status Internal Server Error'() { @@ -130,11 +130,11 @@ class CpsRestExceptionHandlerSpec extends Specification { */ def setupTestException(exception) { - mockCpService.getJsonById(_) >> { throw exception } + mockCpsAdminService.getAnchors(_) >> { throw exception} } def performTestRequest() { - return mockMvc.perform(get('/json-object/1')).andReturn().response + return mockMvc.perform(get('/v1/dataspaces/dataspace-name/anchors')).andReturn().response } void assertTestResponse(response, expectedStatus, expectedErrorMessage, expectedErrorDetails) { -- cgit 1.2.3-korg