diff options
Diffstat (limited to 'catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogicTest.java')
-rw-r--r-- | catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogicTest.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogicTest.java index 36f7084755..6d30003810 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogicTest.java @@ -1,3 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * Modifications copyright (c) 2019 Nokia + * ================================================================================ + */ package org.openecomp.sdc.be.components.impl; import java.util.ArrayList; @@ -14,6 +35,7 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.mockito.junit.MockitoJUnitRunner; +import org.openecomp.sdc.be.components.impl.exceptions.ByResponseFormatComponentException; import org.openecomp.sdc.be.components.impl.exceptions.ComponentException; import org.openecomp.sdc.be.components.validation.UserValidations; import org.openecomp.sdc.be.dao.api.ActionStatus; @@ -189,7 +211,7 @@ public class ElementBusinessLogicTest { @Test(expected = ComponentException.class) public void testGetAllCategories_givenValidationOfUserFails_thenReturnsError() { - doThrow(new ComponentException(new ResponseFormat())).when(userValidations).validateUserExists(eq(user.getUserId()), + doThrow(new ByResponseFormatComponentException(new ResponseFormat())).when(userValidations).validateUserExists(eq(user.getUserId()), anyString(), anyBoolean()); elementBusinessLogic.getAllCategories(null, user.getUserId()); } @@ -268,7 +290,7 @@ public class ElementBusinessLogicTest { @Test(expected = ComponentException.class) public void testCreateSubCategory_givenUserValidationFails_thenReturnsException() { SubCategoryDefinition subCategoryDefinition = new SubCategoryDefinition(); - doThrow(new ComponentException(new ResponseFormat())).when(userValidations).validateUserExists(eq(user.getUserId()), + doThrow(new ByResponseFormatComponentException(new ResponseFormat())).when(userValidations).validateUserExists(eq(user.getUserId()), anyString(), anyBoolean()); elementBusinessLogic.createSubCategory(subCategoryDefinition, "resources", "cat1", user.getUserId()); } |