aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/test/java
diff options
context:
space:
mode:
authorSreeja Gattagouni <SG00744975@techmahindra.com>2024-06-10 13:14:36 +0530
committerSANKET KS <sx00562924@techmahindra.com>2024-07-08 06:04:42 +0000
commit989d7f3d6ae740e30480bfc7d49acfbaf014d393 (patch)
tree0604e03d4e6910f39d66f7240eb6b448e4d05b4c /bpmn/so-bpmn-tasks/src/test/java
parent7100db88beb76d9f23accaad9d0ccd91f7633304 (diff)
Upgrade SO to Java_17
-Removal of aff and logging-filter-base dependencies. -CI build java17 branch-jdk17 version:https://gerrit.onap.org/r/c/ci-management/+/138252 Issue-ID: SO-4125 Change-ID: I58f07f888a814b999f92f8d89909b0666d0b9699 Signed-off-by: Sreeja Gattagouni <SG00744975@techmahindra.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test/java')
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/buildingblock/HomingV2Test.java14
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/CnfmHttpServiceConfigurationTest.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorUnitTest.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java27
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/NetworkAdapterClientIT.java2
8 files changed, 33 insertions, 34 deletions
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..2430cc5550 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,8 @@ public class HomingV2Test {
homingV2.callHoming(givenExecution);
then(oofHoming).should().callOof(givenExecution);
- then(sniroHoming).shouldHaveZeroInteractions();
+ then(oofHoming).shouldHaveNoInteractions();
+
}
@Test
@@ -99,7 +100,8 @@ public class HomingV2Test {
homingV2.processSolution(givenExecution, "dummy");
then(oofHoming).should().processSolution(givenExecution, "dummy");
- then(sniroHoming).shouldHaveZeroInteractions();
+ then(oofHoming).shouldHaveNoInteractions();
+
}
@Test
@@ -113,7 +115,7 @@ public class HomingV2Test {
homingV2.callHoming(givenExecution);
then(oofHoming).should().callOof(givenExecution);
- then(sniroHoming).shouldHaveZeroInteractions();
+ then(oofHoming).shouldHaveNoInteractions();
}
@Test
@@ -127,7 +129,7 @@ public class HomingV2Test {
homingV2.processSolution(givenExecution, "dummy");
then(oofHoming).should().processSolution(givenExecution, "dummy");
- then(sniroHoming).shouldHaveZeroInteractions();
+ then(oofHoming).shouldHaveNoInteractions();
}
private BuildingBlockExecution createBuildingBlockExecutionMock(Map<String, Object> userParams) {
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/CnfmHttpServiceConfigurationTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/CnfmHttpServiceConfigurationTest.java
index 48325972ec..e47744ec20 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/CnfmHttpServiceConfigurationTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/CnfmHttpServiceConfigurationTest.java
@@ -21,6 +21,7 @@
package org.onap.so.bpmn.infrastructure.adapter.cnfm.tasks;
import static org.junit.Assert.assertNotNull;
+import org.apache.hc.client5.http.classic.HttpClient;
import org.apache.http.impl.client.CloseableHttpClient;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -46,7 +47,8 @@ public class CnfmHttpServiceConfigurationTest {
public void cnfmHttpRestServiceProvider_NotNull() {
final CnfmHttpServiceConfiguration objForTest = new CnfmHttpServiceConfiguration();
- HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpclient);
+ HttpComponentsClientHttpRequestFactory requestFactory =
+ new HttpComponentsClientHttpRequestFactory((HttpClient) httpclient);
Mockito.when(httpComponentsClientConfiguration.httpComponentsClientHttpRequestFactory())
.thenReturn(requestFactory);
final HttpRestServiceProvider returnedValue = objForTest
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java
index e435909f59..3eb8b8e444 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java
@@ -41,7 +41,7 @@ import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.ExceptionBuilder;
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 0da683de62..2fd279f46c 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 2e4d99f9c6..487c57bf48 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;
@@ -62,6 +61,7 @@ import org.onap.aai.domain.yang.VolumeGroup;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulatorListenerRunner;
import org.onap.so.bpmn.core.WorkflowException;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.*;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
@@ -121,7 +121,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 a044944f29..20e08b2b05 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
@@ -35,7 +35,6 @@ import static org.junit.Assert.assertThat;
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;
@@ -178,7 +177,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);
@@ -1725,26 +1724,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<org.onap.aai.domain.yang.Vnfc> vnfcs = new ArrayList<org.onap.aai.domain.yang.Vnfc>();
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<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
@@ -1813,11 +1810,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);
}
@@ -1990,16 +1987,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<org.onap.aai.domain.yang.Vnfc> vnfcs = new ArrayList<org.onap.aai.domain.yang.Vnfc>();
- 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<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
@@ -2063,8 +2059,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/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/NetworkAdapterClientIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/NetworkAdapterClientIT.java
index 251ab2cb74..41b986f66d 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/NetworkAdapterClientIT.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/NetworkAdapterClientIT.java
@@ -29,7 +29,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.put;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;