From 9cfc03f3af00d0128a5b22e32cc5ba439de627b6 Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Fri, 30 Jun 2023 12:14:07 +0100 Subject: Combine alreadyDefinedException classes Issue-ID: CPS-1774 Signed-off-by: danielhanrahan Change-Id: I52ff9074a9f8188e8635a811b0d2713a97cb4b10 --- .../groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cps-service/src/test/groovy') diff --git a/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy index 5bd367834..8db106334 100755 --- a/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy +++ b/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation + * Copyright (C) 2021-2023 Nordix Foundation * Modifications Copyright (C) 2021 Pantheon.tech * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +18,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.cps.spi.exceptions import spock.lang.Specification @@ -152,10 +153,10 @@ class CpsExceptionsSpec extends Specification { == "Anchor with name ${anchorName} already exists for ${dataspaceName}." } - def 'Creating a exception that a data node already exists.'() { + def 'Creating a exception that data nodes already exist.'() { expect: 'the exception details contains the correct message with xpath and dataspace name.' - (AlreadyDefinedException.forDataNode(xpath, dataspaceName, rootCause)).details - == "Data node with name ${xpath} already exists for ${dataspaceName}." + (AlreadyDefinedException.forDataNodes([xpath], anchorName)).details + == "1 data node(s) already exist for ${anchorName}." } def 'Creating a exception that a schema set already exists.'() { -- cgit 1.2.3-korg