aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/DmaapPropertiesClientTest.java41
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisherTest.java12
-rw-r--r--bpmn/mso-infrastructure-bpmn/pom.xml6
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml2
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java20
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java37
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java37
8 files changed, 81 insertions, 76 deletions
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 c50a6db178..886025cb51 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
@@ -20,27 +20,30 @@
package org.onap.so.client.dmaapproperties;
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
import java.io.File;
import java.io.IOException;
-import org.apache.http.HttpStatus;
+import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.so.BaseTest;
import org.onap.so.client.avpn.dmaap.beans.AVPNDmaapBean;
import org.onap.so.client.exception.MapperException;
-import org.onap.so.BaseTest;
+import org.onap.so.client.dmaapproperties.GlobalDmaapPublisher;
import org.springframework.beans.factory.annotation.Autowired;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-import static com.github.tomakehurst.wiremock.client.WireMock.*;
public class DmaapPropertiesClientTest extends BaseTest{
@@ -75,10 +78,24 @@ public class DmaapPropertiesClientTest extends BaseTest{
@Test
public void testDmaapPublishRequest() throws JsonProcessingException, MapperException {
- stubFor(post(urlEqualTo("/events/com.att.mso.asyncStatusUpdate?timeout=60000"))
- .willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_ACCEPTED)));
-
- dmaapPropertiesClient.dmaapPublishRequest(requestId, clientSource, correlator, serviceInstanceId, startTime, finishTime, requestScope,
- requestType, timestamp, requestState, statusMessage, percentProgress, false);
+ DmaapPropertiesClient client = Mockito.spy(DmaapPropertiesClient.class);
+ GlobalDmaapPublisher mockedClientDmaapPublisher = Mockito.mock(GlobalDmaapPublisher.class);
+ AVPNDmaapBean mockedDmaapBean = Mockito.mock(AVPNDmaapBean.class);
+ String request = "test";
+
+ doReturn(mockedDmaapBean).when(client).buildRequestJson(requestId, clientSource, correlator, serviceInstanceId, startTime, finishTime, requestScope,
+ requestType, timestamp, requestState, statusMessage, percentProgress, false);
+
+ AVPNDmaapBean actualDmaapBean = client.buildRequestJson(requestId, clientSource, correlator, serviceInstanceId, startTime, finishTime, requestScope,
+ requestType, timestamp, requestState, statusMessage, percentProgress, false);
+ mockedClientDmaapPublisher.send(request);
+
+ doNothing().when(mockedClientDmaapPublisher).send(anyString());
+
+ verify(client, times(1)).buildRequestJson(requestId, clientSource, correlator, serviceInstanceId, startTime,
+ finishTime, requestScope, requestType, timestamp, requestState, statusMessage, percentProgress, false);
+ verify(mockedClientDmaapPublisher, times(1)).send(request);
+
+ assertNotNull(actualDmaapBean);
}
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisherTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisherTest.java
index fc69f812be..088b01873c 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisherTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisherTest.java
@@ -21,23 +21,27 @@
package org.onap.so.client.dmaapproperties;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.so.BaseTest;
import org.springframework.beans.factory.annotation.Autowired;
public class GlobalDmaapPublisherTest extends BaseTest{
+ @BeforeClass
+ public static void setUp() throws Exception {
+ System.setProperty("mso.global.dmaap.host", "http://test:1234");
+ }
+
@Autowired
private GlobalDmaapPublisher globalDmaapPublisher;
-
-
+
@Test
public void testGetters() {
assertEquals("81B7E3533B91A6706830611FB9A8ECE529BBCCE754B1F1520FA7C8698B42F97235BEFA993A387E664D6352C63A6185D68DA7F0B1D360637CBA102CB166E3E62C11EB1F75386D3506BCECE51E54", globalDmaapPublisher.getAuth());
assertEquals("07a7159d3bf51a0e53be7a8f89699be7", globalDmaapPublisher.getKey());
assertEquals("com.att.mso.asyncStatusUpdate", globalDmaapPublisher.getTopic());
- assertEquals("http://localhost:" + wireMockPort, globalDmaapPublisher.getHost().get());
+ assertEquals("http://test:1234", globalDmaapPublisher.getHost().get());
}
}
diff --git a/bpmn/mso-infrastructure-bpmn/pom.xml b/bpmn/mso-infrastructure-bpmn/pom.xml
index 5d0d05df92..fceb1812ba 100644
--- a/bpmn/mso-infrastructure-bpmn/pom.xml
+++ b/bpmn/mso-infrastructure-bpmn/pom.xml
@@ -175,6 +175,12 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jdbc</artifactId>
+ </exclusion>
+ </exclusions>
<optional>true</optional>
</dependency>
<dependency>
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml b/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml
index 829fc12474..d3d2c60a37 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml
+++ b/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml
@@ -8,7 +8,7 @@ mso:
spring:
datasource:
driver-class-name: org.mariadb.jdbc.Driver
- jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/camundabpmn
+ url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/camundabpmn
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
http:
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml b/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml
index 09ffc0eb5c..56a92cbd01 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml
+++ b/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml
@@ -157,7 +157,7 @@ sniro:
headers.latestVersion: 2
spring:
datasource:
- jdbc-url: jdbc:mariadb://localhost:3307/camundabpmn
+ url: jdbc:mariadb://localhost:3307/camundabpmn
username: root
password: password
driver-class-name: org.mariadb.jdbc.Driver
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
index a975339e58..1b185f7c03 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
@@ -31,7 +31,6 @@ import com.google.common.base.Strings;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.onap.so.bpmn.common.scripts.ExceptionUtil;
-import org.onap.so.logger.MsoLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@@ -40,13 +39,12 @@ import org.springframework.stereotype.Component;
public class PnfCheckInputs implements JavaDelegate {
public static final String UUID_REGEX = "(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[1-5]{1}[0-9a-f]{3}-[89ab]{1}[0-9a-f]{3}-[0-9a-f]{12}$";
- private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL, PnfCheckInputs.class);
- private String defaultTimeout;
+ private String pnfEntryNotificationTimeout;
@Autowired
- public PnfCheckInputs(@Value("${aai.pnfEntryNotificationTimeout}") String defaultTimeout) {
- this.defaultTimeout = defaultTimeout;
+ public PnfCheckInputs(@Value("${aai.pnfEntryNotificationTimeout}") String pnfEntryNotificationTimeout) {
+ this.pnfEntryNotificationTimeout = pnfEntryNotificationTimeout;
}
@Override
@@ -75,15 +73,11 @@ public class PnfCheckInputs implements JavaDelegate {
}
private void validateTimeout(DelegateExecution execution) {
- String timeout = (String) execution.getVariable(TIMEOUT_FOR_NOTIFICATION);
- if (Strings.isNullOrEmpty(timeout)) {
- LOGGER.debug("timeoutForPnfEntryNotification variable not found, setting default");
- if (defaultTimeout == null) {
- new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999,
- "default timeoutForPnfEntryNotification value not defined");
- }
- execution.setVariable(TIMEOUT_FOR_NOTIFICATION, defaultTimeout);
+ if (Strings.isNullOrEmpty(pnfEntryNotificationTimeout)) {
+ new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999,
+ "timeoutForPnfEntryNotification value not defined");
}
+ execution.setVariable(TIMEOUT_FOR_NOTIFICATION, pnfEntryNotificationTimeout);
}
private void validateServiceInstanceId(DelegateExecution execution) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
index 48c78632dd..477dc34dbd 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -127,7 +129,7 @@ public class ServicePluginFactory {
return newRequest;
}
- List<Resource> addResourceList = new ArrayList<Resource>();
+ List<Resource> addResourceList = new ArrayList<>();
addResourceList.addAll(serviceDecomposition.getServiceResources());
serviceDecomposition.setVnfResources(null);
@@ -237,7 +239,7 @@ public class ServicePluginFactory {
String url = getInventoryOSSEndPoint();
url += "/oss/inventory?location=" + UriUtils.encode(locationAddress,"UTF-8");
String responseContent = sendRequest(url, "GET", "");
- List<Object> accessTPs = new ArrayList<Object>();
+ List<Object> accessTPs = new ArrayList<>();
if (null != responseContent) {
accessTPs = getJsonObject(responseContent, List.class);
}
@@ -246,8 +248,8 @@ public class ServicePluginFactory {
@SuppressWarnings("unchecked")
private void putResourceRequestInputs(Map<String, Object> resource, Map<String, Object> resourceInputs) {
- Map<String, Object> resourceParametersObject = new HashMap<String, Object>();
- Map<String, Object> resourceRequestInputs = new HashMap<String, Object>();
+ Map<String, Object> resourceParametersObject = new HashMap<>();
+ Map<String, Object> resourceRequestInputs = new HashMap<>();
resourceRequestInputs.put("requestInputs", resourceInputs);
resourceParametersObject.put("parameters", resourceRequestInputs);
@@ -428,7 +430,6 @@ public class ServicePluginFactory {
// this method check if pInterface is remote
private boolean isRemotePInterface(AAIResourcesClient client, AAIResourceUri uri) {
- Map<String, String> keys = uri.getURIKeys();
String uriString = uri.build().toString();
if (uriString != null) {
@@ -555,14 +556,14 @@ public class ServicePluginFactory {
}
private List<Object> queryTerminalPointsFromServiceProviderSystem(String srcLocation, String dstLocation) {
- Map<String, String> locationSrc = new HashMap<String, String>();
+ Map<String, String> locationSrc = new HashMap<>();
locationSrc.put("location", srcLocation);
- Map<String, String> locationDst = new HashMap<String, String>();
+ Map<String, String> locationDst = new HashMap<>();
locationDst.put("location", dstLocation);
- List<Map<String, String>> locations = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> locations = new ArrayList<>();
locations.add(locationSrc);
locations.add(locationDst);
- List<Object> returnList = new ArrayList<Object>();
+ List<Object> returnList = new ArrayList<>();
String reqContent = getJsonString(locations);
String url = getThirdSPEndPoint();
String responseContent = sendRequest(url, "POST", reqContent);
@@ -604,7 +605,7 @@ public class ServicePluginFactory {
Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service");
Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters");
Map<String, Object> serviceRequestInputs = (Map<String, Object>) serviceParametersObject.get("requestInputs");
- Map<String, Object> oofQueryObject = new HashMap<String, Object>();
+ Map<String, Object> oofQueryObject = new HashMap<>();
List<Object> resources = (List<Object>) serviceParametersObject.get("resources");
oofQueryObject.put("src-access-provider-id", serviceRequestInputs.get("inner-src-access-provider-id"));
oofQueryObject.put("src-access-client-id", serviceRequestInputs.get("inner-src-access-client-id"));
@@ -620,7 +621,7 @@ public class ServicePluginFactory {
String url = getOOFCalcEndPoint();
String responseContent = sendRequest(url, "POST", oofRequestReq);
- List<Object> returnList = new ArrayList<Object>();
+ List<Object> returnList = new ArrayList<>();
if (null != responseContent) {
returnList = getJsonObject(responseContent, List.class);
}
@@ -635,7 +636,7 @@ public class ServicePluginFactory {
}
private Map<String, Object> getReturnRoute(List<Object> returnList){
- Map<String, Object> returnRoute = new HashMap<String,Object>();
+ Map<String, Object> returnRoute = new HashMap<>();
for(Object returnVpn :returnList){
Map<String, Object> returnVpnInfo = (Map<String, Object>) returnVpn;
String accessTopoId = (String)returnVpnInfo.get("access-topology-id");
@@ -664,11 +665,11 @@ public class ServicePluginFactory {
private Map<String, Object> getResourceParams(Execution execution, String resourceCustomizationUuid,
String serviceParameters) {
List<String> resourceList = jsonUtil.StringArrayToList(execution,
- (String) JsonUtils.getJsonValue(serviceParameters, "resources"));
+ JsonUtils.getJsonValue(serviceParameters, "resources"));
// Get the right location str for resource. default is an empty array.
String resourceInputsFromUui = "";
for (String resource : resourceList) {
- String resCusUuid = (String) JsonUtils.getJsonValue(resource, "resourceCustomizationUuid");
+ String resCusUuid = JsonUtils.getJsonValue(resource, "resourceCustomizationUuid");
if (resourceCustomizationUuid.equals(resCusUuid)) {
String resourceParameters = JsonUtils.getJsonValue(resource, "parameters");
resourceInputsFromUui = JsonUtils.getJsonValue(resourceParameters, "requestInputs");
@@ -738,14 +739,6 @@ public class ServicePluginFactory {
method = httpDelete;
}
- // now have no auth
- // String userCredentials =
- // SDNCAdapterProperties.getEncryptedProperty(Constants.SDNC_AUTH_PROP,
- // Constants.DEFAULT_SDNC_AUTH, Constants.ENCRYPTION_KEY);
- // String authorization = "Basic " +
- // DatatypeConverter.printBase64Binary(userCredentials.getBytes());
- // method.setHeader("Authorization", authorization);
-
httpResponse = client.execute(method);
String responseContent = null;
if (null != httpResponse && httpResponse.getEntity() != null) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java
index 1637b1a97f..80693d7ce6 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java
@@ -20,14 +20,13 @@
package org.onap.so.bpmn.infrastructure.pnf.delegate;
-import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
-import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.TIMEOUT_FOR_NOTIFICATION;
import java.util.UUID;
+import org.apache.commons.lang3.StringUtils;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
@@ -36,7 +35,7 @@ import org.junit.Test;
public class PnfCheckInputsTest {
- private static final String DEFAULT_TIMEOUT = "P1D";
+ private static final String PNF_ENTRY_NOTIFICATION_TIMEOUT = "P1D";
private static final String VALID_UUID = UUID.nameUUIDFromBytes("testUuid".getBytes()).toString();
private static final String RESERVED_UUID = new UUID(0, 0).toString();
private static final String DEFAULT_SERVICE_INSTANCE_ID = "da7d07d9-b71c-4128-809d-2ec01c807169";
@@ -51,50 +50,49 @@ public class PnfCheckInputsTest {
@Test
public void shouldThrowException_whenCorrelationIdNotSet() {
- PnfCheckInputs testedObject = new PnfCheckInputs(DEFAULT_TIMEOUT);
+ PnfCheckInputs testedObject = new PnfCheckInputs(PNF_ENTRY_NOTIFICATION_TIMEOUT);
DelegateExecution execution = delegateExecutionBuilder.setCorrelationId(null).setPnfUuid(VALID_UUID).build();
assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class);
}
@Test
- public void shouldThrowException_whenTimeoutIsEmptyStringAndDefaultIsNotDefined() {
+ public void shouldThrowException_whenPnfEntryNotificationTimeoutIsNull() {
PnfCheckInputs testedObject = new PnfCheckInputs(null);
- DelegateExecution execution = delegateExecutionBuilder.setTimeoutForNotification("").build();
+ DelegateExecution execution = delegateExecutionBuilder.build();
assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class);
}
@Test
- public void shouldSetDefaultTimeout_whenTimeoutIsNotSet() {
- PnfCheckInputs testedObject = new PnfCheckInputs(DEFAULT_TIMEOUT);
- DelegateExecution execution = delegateExecutionBuilder.setTimeoutForNotification(null).build();
- testedObject.execute(execution);
- assertThat(execution.getVariable(TIMEOUT_FOR_NOTIFICATION)).isEqualTo(DEFAULT_TIMEOUT);
+ public void shouldThrowException_whenPnfEntryNotificationTimeoutIsEmpty() {
+ PnfCheckInputs testedObject = new PnfCheckInputs(StringUtils.EMPTY);
+ DelegateExecution execution = delegateExecutionBuilder.build();
+ assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class);
}
@Test
public void shouldThrowException_whenPnfUuidIsNotSet() {
- PnfCheckInputs testedObject = new PnfCheckInputs(DEFAULT_TIMEOUT);
+ PnfCheckInputs testedObject = new PnfCheckInputs(PNF_ENTRY_NOTIFICATION_TIMEOUT);
DelegateExecution execution = delegateExecutionBuilder.setPnfUuid(null).build();
assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class);
}
@Test
public void shouldThrowException_whenPnfUuidIsEmptyString() {
- PnfCheckInputs testedObject = new PnfCheckInputs(DEFAULT_TIMEOUT);
- DelegateExecution execution = delegateExecutionBuilder.setPnfUuid("").build();
+ PnfCheckInputs testedObject = new PnfCheckInputs(PNF_ENTRY_NOTIFICATION_TIMEOUT);
+ DelegateExecution execution = delegateExecutionBuilder.setPnfUuid(StringUtils.EMPTY).build();
assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class);
}
@Test
public void shouldThrowException_whenPnfUuidIsReservedUuid() {
- PnfCheckInputs testedObject = new PnfCheckInputs(DEFAULT_TIMEOUT);
+ PnfCheckInputs testedObject = new PnfCheckInputs(PNF_ENTRY_NOTIFICATION_TIMEOUT);
DelegateExecution execution = delegateExecutionBuilder.setPnfUuid(RESERVED_UUID).build();
assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class);
}
@Test
public void shouldThrowException_whenServiceInstanceIdIsNotSet() {
- PnfCheckInputs testedObject = new PnfCheckInputs(DEFAULT_TIMEOUT);
+ PnfCheckInputs testedObject = new PnfCheckInputs(PNF_ENTRY_NOTIFICATION_TIMEOUT);
DelegateExecution execution = delegateExecutionBuilder.setServiceInstanceId(null).build();
assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class);
}
@@ -103,7 +101,6 @@ public class PnfCheckInputsTest {
private String correlationId = DEFAULT_CORRELATION_ID;
private String pnfUuid = VALID_UUID;
private String serviceInstanceId = DEFAULT_SERVICE_INSTANCE_ID;
- private String timeoutForNotification;
public DelegateExecutionBuilder setCorrelationId(String correlationId) {
this.correlationId = correlationId;
@@ -120,18 +117,12 @@ public class PnfCheckInputsTest {
return this;
}
- public DelegateExecutionBuilder setTimeoutForNotification(String timeoutForNotification) {
- this.timeoutForNotification = timeoutForNotification;
- return this;
- }
-
public DelegateExecution build() {
DelegateExecution execution = new DelegateExecutionFake();
execution.setVariable("testProcessKey", "testProcessKeyValue");
execution.setVariable(CORRELATION_ID, this.correlationId);
execution.setVariable(PNF_UUID, this.pnfUuid);
execution.setVariable(SERVICE_INSTANCE_ID, this.serviceInstanceId);
- execution.setVariable(TIMEOUT_FOR_NOTIFICATION, this.timeoutForNotification);
return execution;
}
}