From ad3a84f3d7644ef6c2bec17efc991867886d495c Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Thu, 5 Mar 2026 08:19:45 +0100 Subject: [PATCH] Spring-boot 2.6 upgrade - spring-boot (2.5.15 -> 2.6.15) - spring-cloud (2020.0.6 -> 2021.0.6) - updates to mockito 4 which changes import in a lot of test files - spring-boot 2.6 does not allow circular bean references thus @Lazy is added in a few places to break the cycle Issue-ID: SO-4244 Change-Id: I0449f128f1ac80823a456667bce21d4c70e17bf9 Signed-off-by: Fiete Ostkamp --- .../so/openstack/utils/MsoTenantUtilsFactory.java | 7 ++-- .../client/ApplicationControllerCallbackTest.java | 2 +- .../so/asdc/client/ASDCNotificationCallBack.java | 6 ++-- .../src/test/java/org/onap/so/asdc/BaseTest.java | 8 ++--- .../AbstractServiceTaskProcessorTest.groovy | 1 - .../common/scripts/CompleteMsoProcessTest.groovy | 2 +- .../common/scripts/CreateAAIVfModuleTest.groovy | 7 ++-- .../bpmn/common/scripts/ExceptionUtilTest.groovy | 5 ++- .../bpmn/common/scripts/FalloutHandlerTest.groovy | 2 +- .../common/scripts/GenerateVfModuleNameTest.groovy | 2 +- .../scripts/PrepareUpdateAAIVfModuleTest.groovy | 2 +- .../common/scripts/SDNCAdapterRestV1Test.groovy | 9 +++--- .../common/scripts/SDNCAdapterRestV2Test.groovy | 9 +++--- .../so/bpmn/common/scripts/SDNCAdapterTest.groovy | 7 ++-- .../bpmn/common/scripts/SniroHomingV1Test.groovy | 2 +- .../common/scripts/TrinityExceptionUtilTest.groovy | 5 ++- .../common/scripts/UpdateAAIGenericVnfTest.groovy | 2 +- .../common/scripts/UpdateAAIVfModuleTest.groovy | 6 ++-- .../so/bpmn/common/scripts/VidUtilsTest.groovy | 3 +- .../tasks/CloudInfoFromAAITest.java | 2 +- .../dmaapproperties/DmaapPropertiesClientTest.java | 2 +- .../core/plugins/LoggingAndURNMappingPlugin.java | 6 ++-- .../subprocess/PauseForManualTaskActivityTest.java | 2 +- ...VNFCheckClosedLoopDisabledFlagActivityTest.java | 2 +- .../VNFCheckInMaintFlagActivityTest.java | 2 +- .../VNFCheckPserversLockedFlagActivity.java | 2 +- .../VNFSetClosedLoopDisabledFlagActivityTest.java | 2 +- ...VNFUnsetClosedLoopDisabledFlagActivityTest.java | 2 +- .../CreateCustomE2EServiceInstanceTest.groovy | 2 +- .../scripts/CreateVfModuleInfraTest.groovy | 2 +- .../scripts/CreateVfModuleVolumeInfraV1Test.groovy | 2 +- .../scripts/DeleteNetworkInstanceTest.groovy | 2 +- .../scripts/DeleteVfModuleVolumeInfraV1Test.groovy | 2 +- .../DoCreateNetworkInstanceRollbackTest.groovy | 3 +- .../scripts/DoCreateNetworkInstanceTest.groovy | 2 +- .../scripts/DoCreateVfModuleRollbackTest.groovy | 2 +- .../scripts/DoCreateVfModuleTest.groovy | 2 +- .../scripts/DoCreateVfModuleVolumeV2Test.groovy | 4 +-- .../scripts/DoCreateVnfAndModulesTest.groovy | 2 +- .../infrastructure/scripts/DoCreateVnfTest.groovy | 2 +- .../scripts/DoDeleteServiceInstanceTest.groovy | 2 +- .../scripts/DoDeleteVfModuleFromVnfTest.groovy | 2 +- .../scripts/DoDeleteVfModuleTest.groovy | 2 +- .../scripts/DoDeleteVnfAndModulesTest.groovy | 2 +- .../scripts/DoUpdateVfModuleTest.groovy | 2 +- .../scripts/DoUpdateVnfAndModulesTest.groovy | 2 +- .../ScaleCustomE2EServiceInstanceTest.groovy | 2 +- .../scripts/UpdateNetworkInstanceTest.groovy | 2 +- .../scripts/UpdateVfModuleVolumeTest.groovy | 2 +- .../pnf/delegate/InformKafkaClientTest.java | 4 +-- .../pnf/kafka/PnfEventReadyKafkaClientTest.java | 6 ++-- .../onap/so/bpmn/buildingblock/HomingV2Test.java | 12 +++---- .../tasks/OrchestrationStatusValidatorTest.java | 12 +++---- .../OrchestrationStatusValidatorUnitTest.java | 2 +- .../workflow/tasks/WorkflowActionBBTasksTest.java | 3 +- .../workflow/tasks/WorkflowActionTest.java | 37 ++++++++-------------- .../java/org/onap/so/constants/DefaultsTest.java | 8 ++--- .../GlobalHealthcheckHandlerTest.java | 8 ++--- mso-catalog-db/pom.xml | 2 +- pom.xml | 6 ++-- 60 files changed, 121 insertions(+), 133 deletions(-) diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoTenantUtilsFactory.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoTenantUtilsFactory.java index 514cb2eb7b..84aefb927d 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoTenantUtilsFactory.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoTenantUtilsFactory.java @@ -9,9 +9,9 @@ * 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. @@ -29,6 +29,7 @@ import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; @Component @@ -37,8 +38,10 @@ public class MsoTenantUtilsFactory { protected static Logger logger = LoggerFactory.getLogger(MsoTenantUtilsFactory.class); @Autowired protected CloudConfig cloudConfig; + @Lazy @Autowired protected MsoKeystoneUtils keystoneUtils; + @Lazy @Autowired protected MsoKeystoneV3Utils keystoneV3Utils; diff --git a/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallbackTest.java b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallbackTest.java index 695981bb00..184d1f9ae4 100644 --- a/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallbackTest.java +++ b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/client/ApplicationControllerCallbackTest.java @@ -75,7 +75,7 @@ public class ApplicationControllerCallbackTest { response.setStatus(status); doReturn(status).when(applicationControllerSupport).getStatusFromGenericResponse(response); appcTaskCallback.onResponse(response); - Mockito.verifyZeroInteractions(mockExternalTaskService); + Mockito.verifyNoInteractions(mockExternalTaskService); } @Test diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCNotificationCallBack.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCNotificationCallBack.java index 48ae2f145d..b0fdc30d9c 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCNotificationCallBack.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCNotificationCallBack.java @@ -9,9 +9,9 @@ * 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. @@ -27,6 +27,7 @@ import org.onap.sdc.api.notification.INotificationData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; /** @@ -37,6 +38,7 @@ import org.springframework.stereotype.Component; @Component public final class ASDCNotificationCallBack implements INotificationCallback { + @Lazy @Autowired private ASDCController asdcController; diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/BaseTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/BaseTest.java index 944ad2b557..20a0a30c5b 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/BaseTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/BaseTest.java @@ -7,9 +7,9 @@ * 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. @@ -30,7 +30,7 @@ import org.onap.so.asdc.tenantIsolation.WatchdogDistribution; import org.onap.so.spring.SpringContextHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer; +import org.springframework.boot.test.context.ConfigDataApplicationContextInitializer; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.boot.test.mock.mockito.SpyBean; @@ -44,7 +44,7 @@ import com.github.tomakehurst.wiremock.WireMockServer; @RunWith(SpringRunner.class) @SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") -@ContextConfiguration(classes = SpringContextHelper.class, initializers = ConfigFileApplicationContextInitializer.class) +@ContextConfiguration(classes = SpringContextHelper.class, initializers = ConfigDataApplicationContextInitializer.class) @AutoConfigureWireMock(port = 0) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public abstract class BaseTest { diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessorTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessorTest.groovy index 3c3e4aca91..bda3e9a039 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessorTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessorTest.groovy @@ -32,7 +32,6 @@ import static org.mockito.Mockito.* import org.mockito.MockitoAnnotations import org.mockito.junit.MockitoJUnitRunner; -import org.mockito.internal.debugging.MockitoDebuggerImpl import org.junit.Before import org.onap.so.bpmn.common.scripts.AaiUtil; import org.junit.Rule; diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy index 119159f458..0d095c112b 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CompleteMsoProcessTest.groovy @@ -31,7 +31,7 @@ import org.mockito.ArgumentCaptor import org.mockito.Mock import org.mockito.MockitoAnnotations import org.mockito.Spy -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.core.WorkflowException import org.onap.so.db.request.beans.InfraActiveRequests import org.onap.so.db.request.client.RequestsDbClient diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleTest.groovy index 600306927d..41d1d32307 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleTest.groovy @@ -27,7 +27,6 @@ import org.camunda.bpm.engine.delegate.DelegateExecution import static org.assertj.core.api.Assertions.assertThat import static org.mockito.ArgumentMatchers.any -import static org.mockito.ArgumentMatchers.anyObject import static org.mockito.Mockito.mock import static org.mockito.Mockito.when @@ -97,7 +96,7 @@ class CreateAAIVfModuleTest extends MsoGroovyTest{ @Test void testCreateGenericVnf(){ when(mockExecution.getVariable("CAAIVfMod_vnfName")).thenReturn("vnfName") - Mockito.doNothing().when(client).create(any(AAIResourceUri.class) as AAIResourceUri,anyObject()) + Mockito.doNothing().when(client).create(any(AAIResourceUri.class) as AAIResourceUri,any()) createAAIVfModule.createGenericVnf(mockExecution) Mockito.verify(mockExecution).setVariable("CAAIVfMod_createGenericVnfResponseCode", 201) Mockito.verify(mockExecution).setVariable("CAAIVfMod_createGenericVnfResponse","Vnf Created") @@ -112,7 +111,7 @@ class CreateAAIVfModuleTest extends MsoGroovyTest{ when(mockExecution.getVariable("CAAIVfMod_personaId")).thenReturn("model1") when(mockExecution.getVariable("CAAIVfMod_moduleName")).thenReturn("vfModuleName") - Mockito.doNothing().when(client).create(any(AAIResourceUri.class) as AAIResourceUri,anyObject()) + Mockito.doNothing().when(client).create(any(AAIResourceUri.class) as AAIResourceUri,any()) createAAIVfModule.createVfModule(mockExecution,false) Mockito.verify(mockExecution).setVariable("CAAIVfMod_createVfModuleResponseCode", 201) Mockito.verify(mockExecution).setVariable("CAAIVfMod_createVfModuleResponse","Vf Module Created") @@ -173,7 +172,7 @@ class CreateAAIVfModuleTest extends MsoGroovyTest{ Optional genericVnf = getAAIObjectFromJson(GenericVnf.class,"__files/aai/GenericVnfVfModule.json"); when(mockExecution.getVariable("CAAIVfMod_queryGenericVnfResponse")).thenReturn(genericVnf.get()) when(mockExecution.getVariable("CAAIVfMod_moduleName")).thenReturn("vfModuleName") - Mockito.doNothing().when(client).create(any(AAIResourceUri.class) as AAIResourceUri,anyObject()) + Mockito.doNothing().when(client).create(any(AAIResourceUri.class) as AAIResourceUri,any()) createAAIVfModule.createVfModule(mockExecution,true) Mockito.verify(mockExecution).setVariable("CAAIVfMod_createVfModuleResponseCode", 201) Mockito.verify(mockExecution).setVariable("CAAIVfMod_createVfModuleResponse","Vf Module Created") diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtilTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtilTest.groovy index c7015cda50..41f3fbee34 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtilTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtilTest.groovy @@ -22,7 +22,7 @@ package org.onap.so.bpmn.common.scripts import org.junit.Assert import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.junit.Ignore; @@ -33,8 +33,7 @@ import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.junit.Before import org.junit.runner.RunWith import org.mockito.MockitoAnnotations -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.common.scripts.ExceptionUtil; import org.onap.so.bpmn.core.WorkflowException @RunWith(MockitoJUnitRunner.class) diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/FalloutHandlerTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/FalloutHandlerTest.groovy index 6cae293971..7fb3748b39 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/FalloutHandlerTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/FalloutHandlerTest.groovy @@ -32,7 +32,7 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mock import org.mockito.MockitoAnnotations import org.mockito.Spy -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.common.scripts.MsoUtils; import org.onap.so.db.request.beans.InfraActiveRequests import org.onap.so.db.request.client.RequestsDbClient diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleNameTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleNameTest.groovy index 3a408b3310..b5903fd257 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleNameTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleNameTest.groovy @@ -34,7 +34,7 @@ import org.junit.runner.RunWith import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mockito -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.core.WorkflowException import static com.github.tomakehurst.wiremock.client.WireMock.* diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModuleTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModuleTest.groovy index be93399d4d..3791ec6378 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModuleTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModuleTest.groovy @@ -33,7 +33,7 @@ import org.junit.runner.RunWith import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import static org.mockito.Mockito.* diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1Test.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1Test.groovy index e79075a1a1..f22cdf9024 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1Test.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1Test.groovy @@ -26,8 +26,7 @@ import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.MockitoAnnotations -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.mock.FileUtil import org.onap.so.bpmn.core.json.JsonUtils @@ -65,7 +64,7 @@ public class SDNCAdapterRestV1Test { SDNCAdapterRestV1 sdncAdapterRestV1 = new SDNCAdapterRestV1() sdncAdapterRestV1.preProcessRequest(mockExecution) - MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() + //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() //debugger.printInvocations(mockExecution) @@ -100,7 +99,7 @@ public class SDNCAdapterRestV1Test { SDNCAdapterRestV1 sdncAdapterRestV1 = new SDNCAdapterRestV1() sdncAdapterRestV1.preProcessRequest(mockExecution) - MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() + //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() //debugger.printInvocations(mockExecution) @@ -136,7 +135,7 @@ public class SDNCAdapterRestV1Test { SDNCAdapterRestV1 sdncAdapterRestV1 = new SDNCAdapterRestV1() sdncAdapterRestV1.preProcessRequest(mockExecution) - MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() + //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() //debugger.printInvocations(mockExecution) diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2Test.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2Test.groovy index c9e3fead67..fb4d53924a 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2Test.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2Test.groovy @@ -26,8 +26,7 @@ import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.MockitoAnnotations -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.mock.FileUtil import org.onap.so.bpmn.core.json.JsonUtils @@ -65,7 +64,7 @@ public class SDNCAdapterRestV2Test { SDNCAdapterRestV2 sdncAdapterRestV2 = new SDNCAdapterRestV2() sdncAdapterRestV2.preProcessRequest(mockExecution) - MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() + //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() //debugger.printInvocations(mockExecution) @@ -100,7 +99,7 @@ public class SDNCAdapterRestV2Test { SDNCAdapterRestV2 sdncAdapterRestV2 = new SDNCAdapterRestV2() sdncAdapterRestV2.preProcessRequest(mockExecution) - MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() + //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() //debugger.printInvocations(mockExecution) @@ -136,7 +135,7 @@ public class SDNCAdapterRestV2Test { SDNCAdapterRestV2 sdncAdapterRestV2 = new SDNCAdapterRestV2() sdncAdapterRestV2.preProcessRequest(mockExecution) - MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() + //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() //debugger.printInvocations(mockExecution) diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterTest.groovy index 235b6219d1..8dd9b54936 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterTest.groovy @@ -31,7 +31,6 @@ import org.junit.Test import org.junit.runner.RunWith import org.mockito.MockitoAnnotations import org.mockito.junit.MockitoJUnitRunner; -import org.mockito.internal.debugging.MockitoDebuggerImpl import org.onap.so.bpmn.common.scripts.SDNCAdapter; import org.onap.so.bpmn.mock.FileUtil @@ -834,8 +833,8 @@ def sdncAdapterResponseError = SDNCAdapter sdncAdapter = new SDNCAdapter() sdncAdapter.preProcessRequest(mockExecution) - MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() - debugger.printInvocations(mockExecution) + //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() + //debugger.printInvocations(mockExecution) verify(mockExecution).setVariable("prefix","SDNCA_") @@ -948,4 +947,4 @@ def sdncAdapterResponseError = } -} \ No newline at end of file +} diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1Test.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1Test.groovy index e3942f0d2e..bcf800667a 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1Test.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1Test.groovy @@ -35,7 +35,7 @@ import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.core.WorkflowException import org.onap.so.bpmn.core.domain.AllottedResource import org.onap.so.bpmn.core.domain.ModelInfo diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/TrinityExceptionUtilTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/TrinityExceptionUtilTest.groovy index 14fb60c245..b8297ddbc0 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/TrinityExceptionUtilTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/TrinityExceptionUtilTest.groovy @@ -23,7 +23,7 @@ package org.onap.so.bpmn.common.scripts import org.junit.Assert import org.junit.Ignore import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @@ -33,8 +33,7 @@ import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.junit.Before import org.junit.runner.RunWith import org.mockito.MockitoAnnotations -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.common.scripts.TrinityExceptionUtil; @RunWith(MockitoJUnitRunner.class) import org.junit.Test diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnfTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnfTest.groovy index 2289dab4e9..8017a9a521 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnfTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnfTest.groovy @@ -34,7 +34,7 @@ import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.core.WorkflowException import org.onap.so.bpmn.mock.FileUtil diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy index 94317f49ae..8359c8af1b 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy @@ -111,7 +111,7 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest { vfModule.setVfModuleId("supercool") vfModule.setResourceVersion("12345") when(mockExecution.getVariable(prefix + "getVfModuleResponse")).thenReturn(vfModule) - doNothing().when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject()) + doNothing().when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, any()) updateAAIVfModule.updateVfModule(mockExecution) verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 200) } @@ -126,7 +126,7 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest { vfModule.setVfModuleId("supercool") vfModule.setResourceVersion("12345") when(mockExecution.getVariable(prefix + "getVfModuleResponse")).thenReturn(vfModule) - doThrow(new NotFoundException("Vf Module not found")).when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject()) + doThrow(new NotFoundException("Vf Module not found")).when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, any()) thrown.expect(BpmnError.class) updateAAIVfModule.updateVfModule(mockExecution) verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 404) @@ -143,7 +143,7 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest { vfModule.setVfModuleId("supercool") vfModule.setResourceVersion("12345") when(mockExecution.getVariable(prefix + "getVfModuleResponse")).thenReturn(vfModule) - doThrow(new IllegalStateException("Error in AAI client")).when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject()) + doThrow(new IllegalStateException("Error in AAI client")).when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, any()) thrown.expect(BpmnError.class) updateAAIVfModule.updateVfModule(mockExecution) verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 500) diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VidUtilsTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VidUtilsTest.groovy index b80cb87c16..34baf5d516 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VidUtilsTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VidUtilsTest.groovy @@ -38,8 +38,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import static org.junit.Assert.*; import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.mockito.internal.debugging.MockitoDebuggerImpl +import org.mockito.junit.MockitoJUnitRunner import org.junit.Before import org.junit.Rule; import org.junit.Test diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/CloudInfoFromAAITest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/CloudInfoFromAAITest.java index 7ca08f3582..5443ef3b83 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/CloudInfoFromAAITest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/CloudInfoFromAAITest.java @@ -36,7 +36,7 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider; import org.onap.aaiclient.client.aai.entities.AAIResultWrapper; import org.onap.aaiclient.client.aai.entities.Relationships; diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/DmaapPropertiesClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/DmaapPropertiesClientTest.java index c2aedfc43e..2df840f2fa 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/DmaapPropertiesClientTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/DmaapPropertiesClientTest.java @@ -23,7 +23,7 @@ package org.onap.so.client.dmaapproperties; import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertNotNull; -import static org.mockito.Matchers.anyString; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.times; diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java index 6de22825b7..7932aa712d 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java @@ -9,9 +9,9 @@ * 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. @@ -42,6 +42,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; @@ -55,6 +56,7 @@ public class LoggingAndURNMappingPlugin extends AbstractProcessEnginePlugin { public static final String SERVICE_INSTANCE_ID = "ServiceInstanceId"; public static final String SERVICE_NAME = "ServiceName"; + @Lazy @Autowired private LoggingParseListener loggingParseListener; diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java index 22c7e2bec6..a6c0ef93cf 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/PauseForManualTaskActivityTest.java @@ -22,7 +22,7 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; import static org.junit.Assert.assertNotNull; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; import org.camunda.bpm.engine.ManagementService; import org.camunda.bpm.engine.TaskService; diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckClosedLoopDisabledFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckClosedLoopDisabledFlagActivityTest.java index 6cde3bb8b5..4f16ef0186 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckClosedLoopDisabledFlagActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckClosedLoopDisabledFlagActivityTest.java @@ -21,7 +21,7 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckInMaintFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckInMaintFlagActivityTest.java index d2bb508c48..340bc926e5 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckInMaintFlagActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckInMaintFlagActivityTest.java @@ -21,7 +21,7 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckPserversLockedFlagActivity.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckPserversLockedFlagActivity.java index aa9d85ece3..254fa625bb 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckPserversLockedFlagActivity.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckPserversLockedFlagActivity.java @@ -21,7 +21,7 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java index 7c2e6106f3..5c303df10d 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java @@ -21,7 +21,7 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetClosedLoopDisabledFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetClosedLoopDisabledFlagActivityTest.java index f54e762c25..e42e98a675 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetClosedLoopDisabledFlagActivityTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetClosedLoopDisabledFlagActivityTest.java @@ -21,7 +21,7 @@ package org.onap.so.bpmn.infrastructure.bpmn.subprocess; import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.runtime.ProcessInstance; diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy index ad5519dba0..90553532fd 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy @@ -33,7 +33,7 @@ import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import static org.junit.Assert.assertNotNull import static org.mockito.Mockito.* diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy index a098e5e95b..72a02202fa 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy @@ -33,7 +33,7 @@ import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import static org.mockito.Mockito.mock import static org.mockito.Mockito.when diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1Test.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1Test.groovy index c19cdfdb04..552f9be2b0 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1Test.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1Test.groovy @@ -30,7 +30,7 @@ import org.junit.rules.ExpectedException import org.junit.runner.RunWith import org.mockito.ArgumentCaptor import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.aai.domain.yang.ResultData import org.onap.aai.domain.yang.SearchResults import org.onap.so.bpmn.common.scripts.MsoGroovyTest diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy index 9b7d7ee21f..9be5fe46db 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteNetworkInstanceTest.groovy @@ -34,7 +34,7 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.common.scripts.MsoUtils import org.onap.so.bpmn.core.WorkflowException diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1Test.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1Test.groovy index 655417a746..192ce6aad2 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1Test.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1Test.groovy @@ -30,7 +30,7 @@ import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations import org.mockito.Spy -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.aai.domain.yang.VolumeGroup import org.onap.so.bpmn.common.scripts.DeleteAAIVfModule import org.onap.so.bpmn.common.scripts.MsoGroovyTest diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy index 9214b386eb..ab970e985c 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy @@ -30,8 +30,7 @@ import org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl import org.camunda.bpm.engine.repository.ProcessDefinition import org.camunda.bpm.engine.delegate.DelegateExecution; import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.mockito.internal.debugging.MockitoDebuggerImpl +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.common.scripts.MsoUtils import org.onap.so.bpmn.core.WorkflowException import org.junit.Before diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy index 2b1e748de5..0bb60b2248 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy @@ -42,7 +42,7 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.aai.domain.yang.L3Network import org.onap.so.bpmn.common.scripts.MsoUtils import org.onap.so.bpmn.core.WorkflowException diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy index 1a15f0eb14..aef33f498a 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy @@ -35,7 +35,7 @@ import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations import org.mockito.Spy -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.aai.domain.yang.NetworkPolicies import org.onap.aai.domain.yang.NetworkPolicy import org.onap.so.bpmn.common.scripts.MsoGroovyTest diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy index 82fbf21215..8569a1c937 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy @@ -34,7 +34,7 @@ import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.common.scripts.utils.XmlComparator import org.onap.so.bpmn.core.RollbackData import org.onap.so.bpmn.core.WorkflowException diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy index d417abc671..591bb8b9ff 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy @@ -22,7 +22,7 @@ package org.onap.so.bpmn.infrastructure.scripts import static org.junit.Assert.assertEquals import static org.junit.Assert.assertNotNull -import static org.mockito.ArgumentMatchers.anyObject +import static org.mockito.ArgumentMatchers.any import static org.mockito.Mockito.spy import static org.mockito.Mockito.times import static org.mockito.Mockito.verify @@ -200,7 +200,7 @@ class DoCreateVfModuleVolumeV2Test extends MsoGroovyTest { when(mockExecution.getVariable(modelCustomizationId)).thenReturn(modelCustomizationId) when(mockExecution.getVariable(lcpCloudRegionId)).thenReturn(lcpCloudRegionId) when(mockExecution.getVariable("DCVFMODVOLV2_createVnfAResponse")).thenReturn("volumeGroupStackId") - when(client.update(anyObject(),anyObject())).thenThrow(Exception.class) + when(client.update(any(),any())).thenThrow(Exception.class) thrown.expect(BpmnError.class) doCreateVfModuleVolumeV2.callRESTUpdateCreatedVolGrpName(mockExecution,null) verify(mockExecution).setVariable("DCVFMODVOLV2_heatStackId","volumeGroupStackId") diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy index 0679bbd079..1ce39ef22c 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy @@ -34,7 +34,7 @@ import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.core.WorkflowException import org.onap.so.bpmn.core.domain.AllottedResource import org.onap.so.bpmn.core.domain.HomingSolution diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy index c57c214826..a1de037135 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy @@ -34,7 +34,7 @@ import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.core.WorkflowException import org.onap.so.bpmn.core.domain.VnfResource diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy index 879d9d36fa..5d69e647e0 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy @@ -35,7 +35,7 @@ import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.core.WorkflowException import org.onap.so.bpmn.mock.FileUtil import org.onap.so.bpmn.vcpe.scripts.GroovyTestBase diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy index da68a213b0..9dde16725e 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy @@ -36,7 +36,7 @@ import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations import org.mockito.Spy -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.aai.domain.yang.GenericVnf import org.onap.aai.domain.yang.NetworkPolicies import org.onap.aai.domain.yang.NetworkPolicy diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy index 1c504834ff..6db414ffac 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy @@ -35,7 +35,7 @@ import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations import org.mockito.Spy -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.aai.domain.yang.NetworkPolicies import org.onap.aai.domain.yang.NetworkPolicy import org.onap.aai.domain.yang.VfModule diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy index 3162a77e8c..fb2a28e5d1 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy @@ -35,7 +35,7 @@ import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations import org.mockito.Spy -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.aai.domain.yang.GenericVnf import org.onap.so.bpmn.common.scripts.MsoGroovyTest import org.onap.so.bpmn.core.WorkflowException diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy index f16bc575a4..1acf00a259 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy @@ -36,7 +36,7 @@ import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations import org.mockito.Spy -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.common.scripts.MsoGroovyTest import org.onap.so.bpmn.common.scripts.VfModule import org.onap.so.bpmn.core.WorkflowException diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy index 8e81e91228..e9234e9a59 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy @@ -35,7 +35,7 @@ import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mockito import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.core.WorkflowException import static com.github.tomakehurst.wiremock.client.WireMock.* diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy index e196a62e1f..db3a4608cc 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy @@ -33,7 +33,7 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.common.scripts.MsoUtils import org.onap.so.bpmn.core.WorkflowException import org.onap.so.bpmn.common.scripts.ExceptionUtil diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy index fd3c1e352f..0fb1d7e9ea 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstanceTest.groovy @@ -34,7 +34,7 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.so.bpmn.common.scripts.MsoUtils import org.onap.so.bpmn.core.WorkflowException diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeTest.groovy index a505a7c8b8..adcfe9bec0 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeTest.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeTest.groovy @@ -32,7 +32,7 @@ import org.junit.runner.RunWith import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner +import org.mockito.junit.MockitoJUnitRunner import org.onap.aai.domain.yang.GenericVnf import org.onap.aai.domain.yang.VfModule import org.onap.aai.domain.yang.VolumeGroup diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformKafkaClientTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformKafkaClientTest.java index d8a102f2b4..11ee2a8bfb 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformKafkaClientTest.java +++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformKafkaClientTest.java @@ -25,7 +25,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; import org.camunda.bpm.engine.ProcessEngineServices; import org.camunda.bpm.engine.RuntimeService; @@ -59,7 +59,7 @@ public class InformKafkaClientTest { // then assertThat(kafkaClientTest.getPnfCorrelationId()).isEqualTo("testPnfCorrelationId"); assertThat(kafkaClientTest.getInformConsumer()).isNotNull(); - verifyZeroInteractions(messageCorrelationBuilder); + verifyNoInteractions(messageCorrelationBuilder); } @Test diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/kafka/PnfEventReadyKafkaClientTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/kafka/PnfEventReadyKafkaClientTest.java index a3f21547d4..ebed723c5c 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/kafka/PnfEventReadyKafkaClientTest.java +++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/kafka/PnfEventReadyKafkaClientTest.java @@ -27,7 +27,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; import java.io.IOException; import java.lang.reflect.Field; @@ -140,7 +140,7 @@ public class PnfEventReadyKafkaClientTest { String.format(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID[0], PNF_CORRELATION_ID_NOT_FOUND_IN_MAP), JSON_EXAMPLE_WITH_PNF_CORRELATION_ID[1])); testedObjectInnerClassThread.run(); - verifyZeroInteractions(threadMockToNotifyCamundaFlow, executorMock); + verifyNoInteractions(threadMockToNotifyCamundaFlow, executorMock); } /** @@ -156,7 +156,7 @@ public class PnfEventReadyKafkaClientTest { when(kafkaConsumerMock.get(any(String.class), any(String.class), any(String.class))) .thenReturn(Arrays.asList(JSON_EXAMPLE_WITH_NO_PNF_CORRELATION_ID)); testedObjectInnerClassThread.run(); - verifyZeroInteractions(threadMockToNotifyCamundaFlow, executorMock); + verifyNoInteractions(threadMockToNotifyCamundaFlow, executorMock); } private void setPrivateField() throws NoSuchFieldException, IllegalAccessException { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/buildingblock/HomingV2Test.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/buildingblock/HomingV2Test.java index 9dd0365e7a..357065f2c6 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/buildingblock/HomingV2Test.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/buildingblock/HomingV2Test.java @@ -51,7 +51,7 @@ public class HomingV2Test { homingV2.callHoming(givenExecution); then(sniroHoming).should().callSniro(givenExecution); - then(oofHoming).shouldHaveZeroInteractions(); + then(oofHoming).shouldHaveNoInteractions(); } @Test @@ -67,7 +67,7 @@ public class HomingV2Test { homingV2.processSolution(givenExecution, "dummy"); then(sniroHoming).should().processSolution(givenExecution, "dummy"); - then(oofHoming).shouldHaveZeroInteractions(); + then(oofHoming).shouldHaveNoInteractions(); } @Test @@ -83,7 +83,7 @@ public class HomingV2Test { homingV2.callHoming(givenExecution); then(oofHoming).should().callOof(givenExecution); - then(sniroHoming).shouldHaveZeroInteractions(); + then(sniroHoming).shouldHaveNoInteractions(); } @Test @@ -99,7 +99,7 @@ public class HomingV2Test { homingV2.processSolution(givenExecution, "dummy"); then(oofHoming).should().processSolution(givenExecution, "dummy"); - then(sniroHoming).shouldHaveZeroInteractions(); + then(sniroHoming).shouldHaveNoInteractions(); } @Test @@ -113,7 +113,7 @@ public class HomingV2Test { homingV2.callHoming(givenExecution); then(oofHoming).should().callOof(givenExecution); - then(sniroHoming).shouldHaveZeroInteractions(); + then(sniroHoming).shouldHaveNoInteractions(); } @Test @@ -127,7 +127,7 @@ public class HomingV2Test { homingV2.processSolution(givenExecution, "dummy"); then(oofHoming).should().processSolution(givenExecution, "dummy"); - then(sniroHoming).shouldHaveZeroInteractions(); + then(sniroHoming).shouldHaveNoInteractions(); } private BuildingBlockExecution createBuildingBlockExecutionMock(Map userParams) { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java index 98f84414db..0639ee5f34 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java @@ -100,7 +100,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { assertEquals(OrchestrationStatusValidationDirective.CONTINUE, execution.getVariable("orchestrationStatusValidationResult")); - Mockito.verifyZeroInteractions(requestsDbClient); + Mockito.verifyNoInteractions(requestsDbClient); } private OrchestrationStatusStateTransitionDirective getOrchestrationStatusStateTransitionDirective( @@ -158,7 +158,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, execution.getVariable("orchestrationStatusValidationResult")); - Mockito.verifyZeroInteractions(requestsDbClient); + Mockito.verifyNoInteractions(requestsDbClient); } @Test @@ -192,7 +192,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { orchestrationStatusValidator.validateOrchestrationStatus(execution); - Mockito.verifyZeroInteractions(requestsDbClient); + Mockito.verifyNoInteractions(requestsDbClient); verify(exceptionBuilder).buildAndThrowWorkflowException(eq(execution), eq(7000), any(NullPointerException.class)); } @@ -217,7 +217,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { orchestrationStatusValidator.validateOrchestrationStatus(execution); - Mockito.verifyZeroInteractions(requestsDbClient); + Mockito.verifyNoInteractions(requestsDbClient); verify(exceptionBuilder).buildAndThrowWorkflowException(eq(execution), eq(7000), any(NullPointerException.class)); } @@ -290,7 +290,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { assertEquals(OrchestrationStatusValidationDirective.CONTINUE, execution.getVariable("orchestrationStatusValidationResult")); - Mockito.verifyZeroInteractions(requestsDbClient); + Mockito.verifyNoInteractions(requestsDbClient); } @@ -575,7 +575,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { assertEquals(OrchestrationStatusValidationDirective.CONTINUE, execution.getVariable("orchestrationStatusValidationResult")); - Mockito.verifyZeroInteractions(requestsDbClient); + Mockito.verifyNoInteractions(requestsDbClient); } @Test diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorUnitTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorUnitTest.java index 442cff981e..10d229c3ac 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorUnitTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorUnitTest.java @@ -28,7 +28,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.common.DelegateExecutionImpl; import org.onap.so.db.catalog.beans.BuildingBlockDetail; diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java index 007d696d2e..b7bc4b8395 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java @@ -27,7 +27,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyObject; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.doNothing; @@ -121,7 +120,7 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { execution = new DelegateExecutionFake(); ServiceInstance servInstance = new ServiceInstance(); servInstance.setServiceInstanceId("TEST"); - when(bbSetupUtils.getAAIServiceInstanceByName(anyString(), anyObject())).thenReturn(servInstance); + when(bbSetupUtils.getAAIServiceInstanceByName(anyString(), any())).thenReturn(servInstance); workflowAction.setBbInputSetupUtils(bbSetupUtils); workflowAction.setBbInputSetup(bbInputSetup); } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java index 9d21541651..4ff4fedb94 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java @@ -13,9 +13,9 @@ * 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. @@ -35,7 +35,6 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyList; -import static org.mockito.ArgumentMatchers.anyObject; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isA; @@ -177,7 +176,7 @@ public class WorkflowActionTest extends BaseTaskTest { execution = new DelegateExecutionFake(); org.onap.aai.domain.yang.ServiceInstance servInstance = new org.onap.aai.domain.yang.ServiceInstance(); servInstance.setServiceInstanceId("TEST"); - when(bbSetupUtils.getAAIServiceInstanceByName(anyString(), anyObject())).thenReturn(servInstance); + when(bbSetupUtils.getAAIServiceInstanceByName(anyString(), any())).thenReturn(servInstance); workflowAction.setBbInputSetupUtils(bbSetupUtils); workflowAction.setBbInputSetup(bbInputSetup); @@ -236,7 +235,6 @@ public class WorkflowActionTest extends BaseTaskTest { initExecution(gAction, bpmnRequest, true); execution.setVariable("requestUri", "v6/serviceInstances/123"); - NorthBoundRequest northBoundRequest = new NorthBoundRequest(); List orchFlows = createFlowList("AssignServiceInstanceBB", "ActivateServiceInstanceBB"); northBoundRequest.setOrchestrationFlowList(orchFlows); @@ -763,7 +761,7 @@ public class WorkflowActionTest extends BaseTaskTest { } @Test - public void selectExecutionListServiceMacroCreateWithMultipleSameModelVnfAndVfModules() throws Exception { + public void selectExecutionListServiceMacroCreateWithMultipleSameModelVnfsAndVfModules() throws Exception { String gAction = "createInstance"; String resource = "Service"; String bpmnRequest = readBpmnRequestFromFile(MACRO_CREATE_SERVICE_MULTIPLE_SAME_MODEL_VNF_VFMODULE); @@ -814,7 +812,6 @@ public class WorkflowActionTest extends BaseTaskTest { .thenReturn(vfModuleCustomization2); when(catalogDbClient.getServiceByID("f2444885-3c76-4ddc-8668-7741c0631495")).thenReturn(service); - Resource serviceResource = new Resource(WorkflowType.SERVICE, "f2444885-3c76-4ddc-8668-7741c0631495", false, null); Resource vnfResource1 = @@ -1339,8 +1336,6 @@ public class WorkflowActionTest extends BaseTaskTest { assertEqualsBulkFlowName(ebbs, "AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB"); } - - @Test public void selectExecutionListALaCarteVfModuleNoVolumeGroupReplaceTest() throws Exception { String gAction = "replaceInstance"; @@ -1724,26 +1719,24 @@ public class WorkflowActionTest extends BaseTaskTest { org.onap.aai.domain.yang.GenericVnf vnf = new org.onap.aai.domain.yang.GenericVnf(); vnf.setVnfId("vnf0"); vnf.setModelCustomizationId("modelCustomizationId"); - when(bbSetupUtils.getAAIGenericVnf(anyObject())).thenReturn(vnf); + when(bbSetupUtils.getAAIGenericVnf(any())).thenReturn(vnf); org.onap.aai.domain.yang.VfModule vfModule = new org.onap.aai.domain.yang.VfModule(); vfModule.setModelCustomizationId("modelCustomizationId"); - when(bbSetupUtils.getAAIVfModule(anyObject(), anyObject())).thenReturn(vfModule); + when(bbSetupUtils.getAAIVfModule(any(), any())).thenReturn(vfModule); List vnfcs = new ArrayList(); org.onap.aai.domain.yang.Vnfc vnfc = new org.onap.aai.domain.yang.Vnfc(); vnfc.setModelInvariantId("modelInvariantId"); vnfc.setVnfcName("testVnfcName"); vnfcs.add(vnfc); - doReturn(vnfcs).when(SPY_workflowAction).getRelatedResourcesInVfModule(anyObject(), anyObject(), anyObject(), - anyObject()); + doReturn(vnfcs).when(SPY_workflowAction).getRelatedResourcesInVfModule(any(), any(), any(), any()); org.onap.aai.domain.yang.Configuration configuration = new org.onap.aai.domain.yang.Configuration(); configuration.setConfigurationId("configurationId"); configuration.setModelCustomizationId("modelCustimizationId"); configuration.setConfigurationName("testConfigurationName"); - doReturn(configuration).when(SPY_workflowAction).getRelatedResourcesInVnfc(anyObject(), anyObject(), - anyObject()); + doReturn(configuration).when(SPY_workflowAction).getRelatedResourcesInVnfc(any(), any(), any()); SPY_workflowAction.selectExecutionList(execution); List ebbs = (List) execution.getVariable("flowsToExecute"); @@ -1812,11 +1805,11 @@ public class WorkflowActionTest extends BaseTaskTest { org.onap.aai.domain.yang.GenericVnf vnf = new org.onap.aai.domain.yang.GenericVnf(); vnf.setVnfId("vnf0"); vnf.setModelCustomizationId("modelCustomizationId"); - when(bbSetupUtils.getAAIGenericVnf(anyObject())).thenReturn(vnf); + when(bbSetupUtils.getAAIGenericVnf(any())).thenReturn(vnf); org.onap.aai.domain.yang.VfModule vfModule = new org.onap.aai.domain.yang.VfModule(); vfModule.setModelCustomizationId("modelCustomizationId"); - when(bbSetupUtils.getAAIVfModule(anyObject(), anyObject())).thenReturn(null); + when(bbSetupUtils.getAAIVfModule(any(), any())).thenReturn(null); SPY_workflowAction.getConfigBuildingBlocks(dataObj); } @@ -1989,16 +1982,15 @@ public class WorkflowActionTest extends BaseTaskTest { org.onap.aai.domain.yang.GenericVnf vnf = new org.onap.aai.domain.yang.GenericVnf(); vnf.setVnfId("vnf0"); vnf.setModelCustomizationId("modelCustomizationId"); - when(bbSetupUtils.getAAIGenericVnf(anyObject())).thenReturn(vnf); + when(bbSetupUtils.getAAIGenericVnf(any())).thenReturn(vnf); org.onap.aai.domain.yang.VfModule vfModule = new org.onap.aai.domain.yang.VfModule(); vfModule.setModelCustomizationId("modelCustomizationId"); - when(bbSetupUtils.getAAIVfModule(anyObject(), anyObject())).thenReturn(vfModule); + when(bbSetupUtils.getAAIVfModule(any(), any())).thenReturn(vfModule); List vnfcs = new ArrayList(); - doReturn(vnfcs).when(SPY_workflowAction).getRelatedResourcesInVfModule(anyObject(), anyObject(), anyObject(), - anyObject()); + doReturn(vnfcs).when(SPY_workflowAction).getRelatedResourcesInVfModule(any(), any(), any(), any()); SPY_workflowAction.selectExecutionList(execution); List ebbs = (List) execution.getVariable("flowsToExecute"); @@ -2061,8 +2053,7 @@ public class WorkflowActionTest extends BaseTaskTest { AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().vnfc(vnfc.getVnfcName())); when(bbSetupUtils.getAAIResourceDepthOne(uri)).thenReturn(vfncWrapper); - doReturn(configurationResultWrappers).when(SPY_workflowAction).getResultWrappersFromRelationships(anyObject(), - anyObject()); + doReturn(configurationResultWrappers).when(SPY_workflowAction).getResultWrappersFromRelationships(any(), any()); org.onap.aai.domain.yang.Configuration configuration = SPY_workflowAction.getRelatedResourcesInVnfc(vnfc, org.onap.aai.domain.yang.Configuration.class, Types.CONFIGURATION); assertEquals("testConfigurationId", configuration.getConfigurationId()); diff --git a/common/common/src/test/java/org/onap/so/constants/DefaultsTest.java b/common/common/src/test/java/org/onap/so/constants/DefaultsTest.java index 11ecc96c36..97251370ef 100644 --- a/common/common/src/test/java/org/onap/so/constants/DefaultsTest.java +++ b/common/common/src/test/java/org/onap/so/constants/DefaultsTest.java @@ -7,9 +7,9 @@ * 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. @@ -26,13 +26,13 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.onap.so.spring.SpringContextHelper; import org.onap.so.test.categories.SpringAware; -import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer; +import org.springframework.boot.test.context.ConfigDataApplicationContextInitializer; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) -@ContextConfiguration(classes = SpringContextHelper.class, initializers = ConfigFileApplicationContextInitializer.class) +@ContextConfiguration(classes = SpringContextHelper.class, initializers = ConfigDataApplicationContextInitializer.class) @ActiveProfiles("test") @Category(SpringAware.class) public class DefaultsTest { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java index 72c842b9c3..47755a09a0 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java @@ -7,9 +7,9 @@ * 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. @@ -35,7 +35,7 @@ import org.mockito.ArgumentMatchers; import org.mockito.Mockito; import org.onap.so.apihandlerinfra.HealthCheckConfig.Endpoint; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer; +import org.springframework.boot.test.context.ConfigDataApplicationContextInitializer; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.boot.test.mock.mockito.SpyBean; import org.springframework.http.HttpEntity; @@ -52,7 +52,7 @@ import org.springframework.web.client.RestTemplate; @RunWith(SpringRunner.class) @ContextConfiguration(classes = {GenericStringConverter.class, HealthCheckConverter.class}, - initializers = {ConfigFileApplicationContextInitializer.class}) + initializers = {ConfigDataApplicationContextInitializer.class}) @ActiveProfiles("test") @EnableConfigurationProperties({HealthCheckConfig.class}) public class GlobalHealthcheckHandlerTest { diff --git a/mso-catalog-db/pom.xml b/mso-catalog-db/pom.xml index b3e6ec866e..e41db76de8 100644 --- a/mso-catalog-db/pom.xml +++ b/mso-catalog-db/pom.xml @@ -37,7 +37,7 @@ - + me.hdpe.bowman bowman-client ${bowman.client.version} diff --git a/pom.xml b/pom.xml index f8a5d6c26b..75a8aadba4 100644 --- a/pom.xml +++ b/pom.xml @@ -66,8 +66,8 @@ content/sites/site/org/onap/so/${project.version}/ 3.4.10 2.1 - 2.5.15 - 2020.0.6 + 2.6.15 + 2021.0.6 7.15.0 false true @@ -1095,7 +1095,7 @@ org.glassfish.jersey.core jersey-common - 2.33 + 2.35 com.h2database -- 2.16.6