diff options
Diffstat (limited to 'bpmn/so-bpmn-tasks/src')
17 files changed, 63 insertions, 61 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/CnfmHttpServiceProviderImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/CnfmHttpServiceProviderImpl.java index 0edeb4089c..7ede5abec9 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/CnfmHttpServiceProviderImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/CnfmHttpServiceProviderImpl.java @@ -60,7 +60,7 @@ public class CnfmHttpServiceProviderImpl implements CnfmHttpServiceProvider { final ResponseEntity<AsInstance> response = httpServiceProvider.postHttpRequest(createAsRequest, url, AsInstance.class); - final HttpStatus httpStatus = response.getStatusCode(); + final HttpStatus httpStatus = (HttpStatus) response.getStatusCode(); if (httpStatus.is2xxSuccessful()) { if (!response.hasBody()) { LOGGER.error("Received response without body: {}", response); @@ -91,7 +91,7 @@ public class CnfmHttpServiceProviderImpl implements CnfmHttpServiceProvider { final String url = cnfmUrlProvider.getInstantiateAsRequestUrl(asInstanceId); final ResponseEntity<AsInstance> response = httpServiceProvider.postHttpRequest(instantiateAsRequest, url, AsInstance.class); - final HttpStatus httpStatus = response.getStatusCode(); + final HttpStatus httpStatus = (HttpStatus) response.getStatusCode(); if (httpStatus.is2xxSuccessful()) { URI statusUri = response.getHeaders().getLocation(); if (statusUri == null) { @@ -116,7 +116,7 @@ public class CnfmHttpServiceProviderImpl implements CnfmHttpServiceProvider { try { final ResponseEntity<AsLcmOpOcc> response = httpServiceProvider.getHttpResponse(url, AsLcmOpOcc.class); - final HttpStatus httpStatus = response.getStatusCode(); + final HttpStatus httpStatus = (HttpStatus) response.getStatusCode(); if (!(httpStatus.equals(HttpStatus.ACCEPTED)) && !(httpStatus.equals(HttpStatus.OK))) { LOGGER.error("Unable to invoke HTTP GET using URL: {}, Response Code: {}", url, httpStatus.value()); @@ -143,7 +143,7 @@ public class CnfmHttpServiceProviderImpl implements CnfmHttpServiceProvider { LOGGER.debug("Will send request to CNFM by uisng the url: {}", url); ResponseEntity<Void> response = httpServiceProvider.deleteHttpRequest(url, Void.class); - final HttpStatus httpStatus = response.getStatusCode(); + final HttpStatus httpStatus = (HttpStatus) response.getStatusCode(); if (!(httpStatus.is2xxSuccessful())) { LOGGER.error("Unable to invoke HTTP DELETE using URL: {}, Response Code: {}", url, httpStatus.value()); return Optional.empty(); @@ -164,7 +164,7 @@ public class CnfmHttpServiceProviderImpl implements CnfmHttpServiceProvider { LOGGER.debug("Will send request to CNFM to terminate by uisng the url: {}", url); ResponseEntity<Void> response = httpServiceProvider.postHttpRequest(terminateAsRequest, url, Void.class); - final HttpStatus httpStatus = response.getStatusCode(); + final HttpStatus httpStatus = (HttpStatus) response.getStatusCode(); if (httpStatus.is2xxSuccessful()) { URI statusUri = response.getHeaders().getLocation(); if (statusUri == null) { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskConfiguration.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskConfiguration.java index fc3d6ab96c..890950fbdb 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskConfiguration.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskConfiguration.java @@ -101,8 +101,8 @@ public class VnfmAdapterCreateVnfTaskConfiguration { logger.info("Setting truststore: {}", trustStore.getURL()); final SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(sslContext); final HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); - final HttpComponentsClientHttpRequestFactory factory = - new HttpComponentsClientHttpRequestFactory(httpClient); + final HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory( + (org.apache.hc.client5.http.classic.HttpClient) httpClient); restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(factory)); } catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException | CertificateException | IOException | UnrecoverableKeyException exception) { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java index 94213bb93f..264ebb5a70 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java @@ -66,7 +66,7 @@ public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvide final ResponseEntity<CreateVnfResponse> response = httpServiceProvider.postHttpRequest(request, url, CreateVnfResponse.class); - final HttpStatus httpStatus = response.getStatusCode(); + final HttpStatus httpStatus = (HttpStatus) response.getStatusCode(); if (!(httpStatus.equals(HttpStatus.ACCEPTED)) && !(httpStatus.equals(HttpStatus.OK))) { LOGGER.error("Unable to invoke HTTP POST using URL: {}, Response Code: {}", url, httpStatus.value()); return Optional.absent(); @@ -104,7 +104,7 @@ public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvide LOGGER.debug("Response received: ", response); - final HttpStatus httpStatus = response.getStatusCode(); + final HttpStatus httpStatus = (HttpStatus) response.getStatusCode(); if (!(httpStatus.equals(HttpStatus.ACCEPTED)) && !(httpStatus.equals(HttpStatus.OK))) { LOGGER.error("Unable to invoke HTTP DELETE using URL: {}, Response Code: {}", url, httpStatus.value()); @@ -136,7 +136,7 @@ public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvide final ResponseEntity<QueryJobResponse> response = httpServiceProvider.getHttpResponse(url, QueryJobResponse.class); - final HttpStatus httpStatus = response.getStatusCode(); + final HttpStatus httpStatus = (HttpStatus) response.getStatusCode(); if (!(httpStatus.equals(HttpStatus.ACCEPTED)) && !(httpStatus.equals(HttpStatus.OK))) { LOGGER.error("Unable to invoke HTTP GET using URL: {}, Response Code: ", url, httpStatus.value()); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClient.java index 62d0c230fb..4c051f9648 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClient.java @@ -20,7 +20,7 @@ package org.onap.so.client.adapter.network; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; import org.onap.so.adapters.nwrest.CreateNetworkRequest; import org.onap.so.adapters.nwrest.CreateNetworkResponse; import org.onap.so.adapters.nwrest.DeleteNetworkRequest; @@ -46,11 +46,14 @@ public interface NetworkAdapterClient { UpdateNetworkResponse updateNetwork(String aaiNetworkId, UpdateNetworkRequest req) throws NetworkAdapterClientException; - Response createNetworkAsync(CreateNetworkRequest req) throws NetworkAdapterClientException; + jakarta.ws.rs.core.Response createNetworkAsync(CreateNetworkRequest req) throws NetworkAdapterClientException; - Response deleteNetworkAsync(String aaiNetworkId, DeleteNetworkRequest req) throws NetworkAdapterClientException; + jakarta.ws.rs.core.Response deleteNetworkAsync(String aaiNetworkId, DeleteNetworkRequest req) + throws NetworkAdapterClientException; - Response rollbackNetworkAsync(String aaiNetworkId, RollbackNetworkRequest req) throws NetworkAdapterClientException; + jakarta.ws.rs.core.Response rollbackNetworkAsync(String aaiNetworkId, RollbackNetworkRequest req) + throws NetworkAdapterClientException; Response updateNetworkAsync(String aaiNetworkId, UpdateNetworkRequest req) throws NetworkAdapterClientException; + } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClientImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClientImpl.java index 8668306f13..38304c4e0f 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClientImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClientImpl.java @@ -20,10 +20,10 @@ package org.onap.so.client.adapter.network; -import javax.ws.rs.InternalServerErrorException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; +import jakarta.ws.rs.InternalServerErrorException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriBuilder; import org.onap.so.adapters.nwrest.CreateNetworkRequest; import org.onap.so.adapters.nwrest.CreateNetworkResponse; import org.onap.so.adapters.nwrest.DeleteNetworkRequest; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java index cb04e97d20..8a318f23ec 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java @@ -20,9 +20,9 @@ package org.onap.so.client.adapter.vnf; -import javax.ws.rs.InternalServerErrorException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.UriBuilder; +import jakarta.ws.rs.InternalServerErrorException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.UriBuilder; import org.onap.so.adapters.vnfrest.CreateVfModuleRequest; import org.onap.so.adapters.vnfrest.CreateVfModuleResponse; import org.onap.so.adapters.vnfrest.DeleteVfModuleRequest; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java index 073b752348..0b27012dc2 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java @@ -20,9 +20,9 @@ package org.onap.so.client.adapter.vnf; -import javax.ws.rs.InternalServerErrorException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.UriBuilder; +import jakarta.ws.rs.InternalServerErrorException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.UriBuilder; import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest; import org.onap.so.adapters.vnfrest.CreateVolumeGroupResponse; import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest; @@ -94,7 +94,7 @@ public class VnfVolumeAdapterClientImpl implements VnfVolumeAdapterClient { protected String buildQueryPath(String aaiVolumeGroupId, String cloudSiteId, String tenantId, String volumeGroupStackId, Boolean skipAAI, String requestId, String serviceInstanceId) { - javax.ws.rs.core.UriBuilder builder = this.getUri("/" + aaiVolumeGroupId); + UriBuilder builder = this.getUri("/" + aaiVolumeGroupId); builder.queryParam("cloudSiteId", cloudSiteId).queryParam("tenantId", tenantId) .queryParam("volumeGroupStackId", volumeGroupStackId).queryParam("skipAAI", skipAAI) .queryParam("msoRequest.requestId", requestId) diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java index 293bcf9f0e..45238c2434 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java @@ -26,7 +26,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import org.apache.commons.lang3.StringUtils; import org.onap.sdnc.northbound.client.model.GenericResourceApiParam; import org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NetworkAdapterResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NetworkAdapterResources.java index b3efa71969..766a87e95c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NetworkAdapterResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NetworkAdapterResources.java @@ -23,7 +23,7 @@ package org.onap.so.client.orchestration; import java.io.UnsupportedEncodingException; import java.util.Map; import java.util.Optional; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; import org.onap.so.adapters.nwrest.CreateNetworkRequest; import org.onap.so.adapters.nwrest.CreateNetworkResponse; import org.onap.so.adapters.nwrest.DeleteNetworkRequest; 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; |