From f47919f1fe367b612fa9c96d34c59f01a541e882 Mon Sep 17 00:00:00 2001
From: "Benjamin, Max (mb388a)"
Date: Mon, 8 Apr 2019 14:14:34 -0400
Subject: Replaced all tabs with spaces in java and pom.xml
Added in maven plugins to enforce coding style rules
Added in eclipse java formatting xml
Change-Id: I3727bbf4ce8dc66abfd8ad21b6cfd0890c5d3ff0
Issue-ID: SO-1765
Signed-off-by: Benjamin, Max (mb388a)
---
.../java/org/onap/so/AllIntegrationTestSuites.java | 3 +-
.../test/java/org/onap/so/BaseIntegrationTest.java | 94 +-
.../java/org/onap/so/EmbeddedMariaDbConfig.java | 28 +-
.../src/test/java/org/onap/so/FileUtil.java | 85 +-
.../java/org/onap/so/IntegrationTestSuite.java | 1 -
.../src/test/java/org/onap/so/TestApplication.java | 18 +-
.../src/test/java/org/onap/so/UnitTestSuite.java | 1 -
.../test/java/org/onap/so/bpmn/BaseTaskTest.java | 128 +-
.../so/bpmn/common/aai/tasks/AAIFlagTasksTest.java | 321 +--
.../onap/so/bpmn/common/data/TestDataSetup.java | 997 +++----
.../aai/tasks/AAICreateTasksTest.java | 1192 +++++----
.../aai/tasks/AAIDeleteTasksTest.java | 365 +--
.../aai/tasks/AAIUpdateTasksTest.java | 1285 ++++-----
.../activity/ExecuteActivityTest.java | 76 +-
.../tasks/NetworkAdapterCreateTasksTest.java | 112 +-
.../tasks/NetworkAdapterDeleteTasksTest.java | 70 +-
.../network/tasks/NetworkAdapterRestV1Test.java | 137 +-
.../tasks/NetworkAdapterUpdateTasksTest.java | 84 +-
.../vnf/tasks/VnfAdapterCreateTasksTest.java | 348 +--
.../vnf/tasks/VnfAdapterDeleteTasksTest.java | 174 +-
.../adapter/vnf/tasks/VnfAdapterImplTest.java | 412 +--
.../adapter/vnfm/tasks/EtsiVnfDeleteTaskTest.java | 124 +-
.../tasks/InputParameterRetrieverTaskTest.java | 2 -
.../vnfm/tasks/MonitorVnfmCreateJobTaskTest.java | 251 +-
.../vnfm/tasks/MonitorVnfmDeleteJobTaskTest.java | 239 +-
.../adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java | 122 +-
.../vnfm/tasks/StubbedBuildingBlockExecution.java | 96 +-
.../adapter/vnfm/tasks/TestConstants.java | 4 +-
.../VnfmAdapterCreateVnfTaskConfigurationTest.java | 1 -
.../vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java | 169 +-
.../tasks/VnfmAdapterServiceProviderImplTest.java | 466 ++--
.../vnfm/tasks/VnfmAdapterUrlProviderTest.java | 1 -
.../utils/InputParametersProviderImplTest.java | 2 -
.../adapter/vnfm/tasks/utils/VnfParameterTest.java | 1 -
.../infrastructure/appc/tasks/AppcRunTasksIT.java | 120 +-
.../appc/tasks/AppcRunTasksTest.java | 86 +-
.../bpmn/infrastructure/audit/AuditTasksTest.java | 67 +-
.../flowspecific/tasks/ActivateVfModuleTest.java | 24 +-
.../tasks/AssignNetworkBBUtilsTest.java | 61 +-
.../flowspecific/tasks/AssignNetworkTest.java | 70 +-
.../flowspecific/tasks/AssignVnfTest.java | 191 +-
.../tasks/CloudSiteCatalogUtilsTest.java | 111 +-
.../flowspecific/tasks/ConfigAssignVnfTest.java | 2 -
.../flowspecific/tasks/ConfigDeployVnfTest.java | 130 +-
.../tasks/ConfigurationScaleOutTest.java | 284 +-
.../tasks/CreateNetworkCollectionTest.java | 152 +-
.../flowspecific/tasks/CreateNetworkTest.java | 90 +-
.../tasks/GenericVnfHealthCheckTest.java | 262 +-
.../flowspecific/tasks/NetworkBBUtilsTest.java | 160 +-
.../flowspecific/tasks/SniroHomingV2IT.java | 941 ++++---
.../flowspecific/tasks/UnassignNetworkBBTest.java | 140 +-
.../flowspecific/tasks/UnassignVnfTest.java | 80 +-
.../tasks/ManualHandlingTasksTest.java | 146 +-
.../tasks/NamingServiceCreateTasksTest.java | 87 +-
.../tasks/NamingServiceDeleteTasksTest.java | 63 +-
.../sdnc/tasks/SDNCActivateTaskTest.java | 169 +-
.../sdnc/tasks/SDNCAssignTasksTest.java | 191 +-
.../sdnc/tasks/SDNCChangeAssignTasksTest.java | 122 +-
.../sdnc/tasks/SDNCDeactivateTaskTest.java | 201 +-
.../sdnc/tasks/SDNCQueryTasksTest.java | 187 +-
.../sdnc/tasks/SDNCRequestTasksTest.java | 241 +-
.../sdnc/tasks/SDNCUnassignTasksTest.java | 203 +-
.../CloudRegionOrchestrationValidatorTest.java | 156 +-
.../workflow/tasks/FlowCompletionTasksTest.java | 57 +-
.../tasks/OrchestrationStatusValidatorTest.java | 812 +++---
.../OrchestrationStatusValidatorUnitTest.java | 45 +-
.../tasks/WorkflowActionBBFailureTest.java | 201 +-
.../workflow/tasks/WorkflowActionBBTasksTest.java | 623 +++--
.../WorkflowActionBBTasksUpdateReqDbTest.java | 97 +-
.../workflow/tasks/WorkflowActionTest.java | 2786 +++++++++++---------
.../workflow/tasks/WorkflowActionUnitTest.java | 110 +-
.../bpmn/sdno/tasks/SDNOHealthCheckTasksTest.java | 121 +-
.../so/client/aai/mapper/AAIObjectMapperTest.java | 1119 ++++----
.../adapter/network/NetworkAdapterClientIT.java | 381 ++-
.../mapper/NetworkAdapterObjectMapperTest.java | 633 ++---
.../so/client/adapter/vnf/VnfAdapterClientIT.java | 348 ++-
.../adapter/vnf/VnfVolumeAdapterClientIT.java | 333 ++-
.../vnf/VnfVolumeAdapterRestPropertiesTest.java | 36 +-
.../vnf/mapper/VnfAdapterObjectMapperTest.java | 604 ++---
.../VnfAdapterVfModuleObjectMapperPayloadTest.java | 1637 ++++++------
.../mapper/VnfAdapterVfModuleObjectMapperTest.java | 155 +-
.../NamingClientResponseValidatorTest.java | 134 +-
.../so/client/namingservice/NamingClientTest.java | 146 +-
.../NamingRequestObjectBuilderTest.java | 142 +-
.../org/onap/so/client/oof/OofClientTestIT.java | 132 +-
.../orchestration/AAICollectionResourcesTest.java | 82 +-
.../AAIConfigurationResourcesTest.java | 135 +-
.../AAIInstanceGroupResourcesTest.java | 147 +-
.../orchestration/AAINetworkResourcesTest.java | 671 ++---
.../AAIServiceInstanceResourcesTest.java | 63 +-
.../orchestration/AAIVfModuleResourcesTest.java | 211 +-
.../client/orchestration/AAIVnfResourcesTest.java | 328 +--
.../orchestration/AAIVolumeGroupResourcesTest.java | 143 +-
.../orchestration/AAIVpnBindingResourcesTest.java | 142 +-
.../orchestration/NamingServiceResourcesTest.java | 109 +-
.../orchestration/NetworkAdapterResourcesTest.java | 327 +--
.../SDNCConfigurationResourcesTest.java | 70 +-
.../orchestration/SDNCNetworkResourcesTest.java | 239 +-
.../SDNCServiceInstanceResourcesTest.java | 192 +-
.../orchestration/SDNCVfModuleResourcesTest.java | 155 +-
.../client/orchestration/SDNCVnfResourcesTest.java | 244 +-
.../SDNOHealthCheckResourcesTest.java | 52 +-
.../VnfAdapterVfModuleResourcesTest.java | 189 +-
.../VnfAdapterVolumeGroupResourcesTest.java | 142 +-
.../policy/CommonObjectMapperProviderTest.java | 4 +-
.../so/client/sdn/common/SdnCommonTasksTest.java | 8 +-
.../java/org/onap/so/client/sdnc/SDNCClientIT.java | 54 +-
.../GCTopologyOperationRequestMapperTest.java | 28 +-
.../mapper/GeneralTopologyObjectMapperTest.java | 742 +++---
.../NetworkTopologyOperationRequestMapperTest.java | 339 +--
.../mapper/ServiceTopologyOperationMapperTest.java | 89 +-
...VfModuleTopologyOperationRequestMapperTest.java | 547 ++--
.../VnfTopologyOperationRequestMapperTest.java | 190 +-
.../onap/so/client/sniro/SniroClientTestIT.java | 98 +-
114 files changed, 14689 insertions(+), 13849 deletions(-)
(limited to 'bpmn/so-bpmn-tasks/src/test')
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/AllIntegrationTestSuites.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/AllIntegrationTestSuites.java
index 23fcddfe8a..c5cdae4425 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/AllIntegrationTestSuites.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/AllIntegrationTestSuites.java
@@ -21,12 +21,11 @@
package org.onap.so;
import org.junit.runner.RunWith;
-
import com.googlecode.junittoolbox.SuiteClasses;
import com.googlecode.junittoolbox.WildcardPatternSuite;
@RunWith(WildcardPatternSuite.class)
@SuiteClasses({"**/SniroHomingV2IT.class"})
-public class AllIntegrationTestSuites{
+public class AllIntegrationTestSuites {
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/BaseIntegrationTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/BaseIntegrationTest.java
index aefe4c64bf..3bb8fb70f2 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/BaseIntegrationTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/BaseIntegrationTest.java
@@ -21,7 +21,6 @@ package org.onap.so;
import java.io.IOException;
import java.io.InputStream;
-
import org.junit.Before;
import org.junit.runner.RunWith;
import org.onap.so.bpmn.buildingblock.SniroHomingV2;
@@ -40,7 +39,6 @@ import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
-
import com.github.tomakehurst.wiremock.WireMockServer;
@RunWith(SpringRunner.class)
@@ -50,60 +48,60 @@ import com.github.tomakehurst.wiremock.WireMockServer;
@AutoConfigureWireMock(port = 0)
public abstract class BaseIntegrationTest extends TestDataSetup {
- @Value("${wiremock.server.port}")
- protected String wireMockPort;
+ @Value("${wiremock.server.port}")
+ protected String wireMockPort;
+
+ @SpyBean
+ protected SDNCClient SPY_sdncClient;
+
+ @SpyBean
+ protected SDNOHealthCheckResources MOCK_sdnoHealthCheckResources;
- @SpyBean
- protected SDNCClient SPY_sdncClient;
+ @SpyBean
+ protected SniroHomingV2 sniroHoming;
- @SpyBean
- protected SDNOHealthCheckResources MOCK_sdnoHealthCheckResources;
+ @SpyBean
+ protected SniroClient sniroClient;
- @SpyBean
- protected SniroHomingV2 sniroHoming;
+ @MockBean
+ protected ApplicationControllerAction appCClient;
- @SpyBean
- protected SniroClient sniroClient;
+ @MockBean
+ protected CatalogDbClient catalogDbClient;
- @MockBean
- protected ApplicationControllerAction appCClient;
+ @Autowired
+ protected WireMockServer wireMockServer;
- @MockBean
- protected CatalogDbClient catalogDbClient;
-
- @Autowired
- protected WireMockServer wireMockServer;
+ @Before
+ public void baseTestBefore() {
+ wireMockServer.resetAll();
+ }
- @Before
- public void baseTestBefore() {
- wireMockServer.resetAll();
- }
- public String readResourceFile(String fileName) {
- InputStream stream;
- try {
- stream = getResourceAsStream(fileName);
- byte[] bytes;
- bytes = new byte[stream.available()];
- if(stream.read(bytes) > 0) {
- stream.close();
- return new String(bytes);
- } else {
- stream.close();
- return "";
- }
- } catch (IOException e) {
- return "";
- }
- }
+ public String readResourceFile(String fileName) {
+ InputStream stream;
+ try {
+ stream = getResourceAsStream(fileName);
+ byte[] bytes;
+ bytes = new byte[stream.available()];
+ if (stream.read(bytes) > 0) {
+ stream.close();
+ return new String(bytes);
+ } else {
+ stream.close();
+ return "";
+ }
+ } catch (IOException e) {
+ return "";
+ }
+ }
- private InputStream getResourceAsStream(String resourceName) throws IOException {
- InputStream stream =
- FileUtil.class.getClassLoader().getResourceAsStream(resourceName);
- if (stream == null) {
- throw new IOException("Can't access resource '" + resourceName + "'");
- }
- return stream;
- }
+ private InputStream getResourceAsStream(String resourceName) throws IOException {
+ InputStream stream = FileUtil.class.getClassLoader().getResourceAsStream(resourceName);
+ if (stream == null) {
+ throw new IOException("Can't access resource '" + resourceName + "'");
+ }
+ return stream;
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java
index fb08e5e830..62d9ecee44 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java
@@ -19,6 +19,7 @@
*/
package org.onap.so;
+
import ch.vorburger.exec.ManagedProcessException;
import ch.vorburger.mariadb4j.DBConfigurationBuilder;
import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
@@ -35,30 +36,25 @@ public class EmbeddedMariaDbConfig {
@Bean
MariaDB4jSpringService mariaDB4jSpringService() {
- MariaDB4jSpringService service = new MariaDB4jSpringService();
-
-
- service.getConfiguration().addArg("--lower_case_table_names=1");
+ MariaDB4jSpringService service = new MariaDB4jSpringService();
+
+
+ service.getConfiguration().addArg("--lower_case_table_names=1");
return service;
}
@Bean
DataSource dataSource(MariaDB4jSpringService mariaDB4jSpringService,
- @Value("${mariaDB4j.databaseName}") String databaseName,
- @Value("${spring.datasource.username}") String datasourceUsername,
- @Value("${spring.datasource.password}") String datasourcePassword,
- @Value("${spring.datasource.driver-class-name}") String datasourceDriver) throws ManagedProcessException {
- //Create our database with default root user and no password
+ @Value("${mariaDB4j.databaseName}") String databaseName,
+ @Value("${spring.datasource.username}") String datasourceUsername,
+ @Value("${spring.datasource.password}") String datasourcePassword,
+ @Value("${spring.datasource.driver-class-name}") String datasourceDriver) throws ManagedProcessException {
+ // Create our database with default root user and no password
mariaDB4jSpringService.getDB().createDB(databaseName);
DBConfigurationBuilder config = mariaDB4jSpringService.getConfiguration();
- return DataSourceBuilder
- .create()
- .username(datasourceUsername)
- .password(datasourcePassword)
- .url(config.getURL(databaseName))
- .driverClassName(datasourceDriver)
- .build();
+ return DataSourceBuilder.create().username(datasourceUsername).password(datasourcePassword)
+ .url(config.getURL(databaseName)).driverClassName(datasourceDriver).build();
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/FileUtil.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/FileUtil.java
index 366c9c11a9..24927b0d1c 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/FileUtil.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/FileUtil.java
@@ -34,51 +34,50 @@ import org.slf4j.LoggerFactory;
*
*
* @author
- * @version ONAP Sep 15, 2017
+ * @version ONAP Sep 15, 2017
*/
public class FileUtil {
private static final Logger logger = LoggerFactory.getLogger(FileUtil.class);
-
- /**
- * Read the specified resource file and return the contents as a String.
- *
- * @param fileName Name of the resource file
- * @return the contents of the resource file as a String
- * @throws IOException if there is a problem reading the file
- */
- public static String readResourceFile(String fileName) {
- InputStream stream;
- try {
- stream = getResourceAsStream(fileName);
- byte[] bytes;
- bytes = new byte[stream.available()];
- if(stream.read(bytes) > 0) {
- stream.close();
- return new String(bytes);
- } else {
- stream.close();
- return "";
- }
- } catch (IOException e) {
- logger.debug("Exception:", e);
- return "";
- }
- }
-
- /**
- * Get an InputStream for the resource specified.
- *
- * @param resourceName Name of resource for which to get InputStream.
- * @return an InputStream for the resource specified.
- * @throws IOException If we can't get the InputStream for whatever reason.
- */
- private static InputStream getResourceAsStream(String resourceName) throws IOException {
- InputStream stream =
- FileUtil.class.getClassLoader().getResourceAsStream(resourceName);
- if (stream == null) {
- throw new IOException("Can't access resource '" + resourceName + "'");
- }
- return stream;
- }
+
+ /**
+ * Read the specified resource file and return the contents as a String.
+ *
+ * @param fileName Name of the resource file
+ * @return the contents of the resource file as a String
+ * @throws IOException if there is a problem reading the file
+ */
+ public static String readResourceFile(String fileName) {
+ InputStream stream;
+ try {
+ stream = getResourceAsStream(fileName);
+ byte[] bytes;
+ bytes = new byte[stream.available()];
+ if (stream.read(bytes) > 0) {
+ stream.close();
+ return new String(bytes);
+ } else {
+ stream.close();
+ return "";
+ }
+ } catch (IOException e) {
+ logger.debug("Exception:", e);
+ return "";
+ }
+ }
+
+ /**
+ * Get an InputStream for the resource specified.
+ *
+ * @param resourceName Name of resource for which to get InputStream.
+ * @return an InputStream for the resource specified.
+ * @throws IOException If we can't get the InputStream for whatever reason.
+ */
+ private static InputStream getResourceAsStream(String resourceName) throws IOException {
+ InputStream stream = FileUtil.class.getClassLoader().getResourceAsStream(resourceName);
+ if (stream == null) {
+ throw new IOException("Can't access resource '" + resourceName + "'");
+ }
+ return stream;
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/IntegrationTestSuite.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/IntegrationTestSuite.java
index 0eddeb1649..50bbc1845f 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/IntegrationTestSuite.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/IntegrationTestSuite.java
@@ -21,7 +21,6 @@
package org.onap.so;
import org.junit.runner.RunWith;
-
import com.googlecode.junittoolbox.SuiteClasses;
import com.googlecode.junittoolbox.WildcardPatternSuite;
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/TestApplication.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/TestApplication.java
index 87153144c8..2e27b346ea 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/TestApplication.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/TestApplication.java
@@ -31,14 +31,14 @@ import org.springframework.context.annotation.Profile;
@SpringBootApplication
@Profile("test")
-@ComponentScan(basePackages = {"org.onap.so"}, nameGenerator = DefaultToShortClassNameBeanNameGenerator.class, excludeFilters = {
- @Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class)})
+@ComponentScan(basePackages = {"org.onap.so"}, nameGenerator = DefaultToShortClassNameBeanNameGenerator.class,
+ excludeFilters = {@Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class)})
public class TestApplication {
- public static void main(String... args) {
- SpringApplication.run(TestApplication.class, args);
- System.getProperties().setProperty("mso.db", "MARIADB");
- System.getProperties().setProperty("server.name", "Springboot");
-
-
- }
+ public static void main(String... args) {
+ SpringApplication.run(TestApplication.class, args);
+ System.getProperties().setProperty("mso.db", "MARIADB");
+ System.getProperties().setProperty("server.name", "Springboot");
+
+
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/UnitTestSuite.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/UnitTestSuite.java
index 82ad6582c5..890c81daeb 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/UnitTestSuite.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/UnitTestSuite.java
@@ -22,7 +22,6 @@ package org.onap.so;
import org.junit.runner.RunWith;
-
import com.googlecode.junittoolbox.SuiteClasses;
import com.googlecode.junittoolbox.WildcardPatternSuite;
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java
index 6dc0b1861d..b40e43b959 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java
@@ -58,96 +58,96 @@ import org.springframework.core.env.Environment;
@RunWith(MockitoJUnitRunner.Silent.class)
public abstract class BaseTaskTest extends TestDataSetup {
- @Mock
- protected AAIVolumeGroupResources aaiVolumeGroupResources;
+ @Mock
+ protected AAIVolumeGroupResources aaiVolumeGroupResources;
- @Mock
- protected AAIServiceInstanceResources aaiServiceInstanceResources;
+ @Mock
+ protected AAIServiceInstanceResources aaiServiceInstanceResources;
- @Mock
- protected AAIVnfResources aaiVnfResources;
+ @Mock
+ protected AAIVnfResources aaiVnfResources;
- @Mock
- protected AAIVfModuleResources aaiVfModuleResources;
+ @Mock
+ protected AAIVfModuleResources aaiVfModuleResources;
- @Mock
- protected AAIVpnBindingResources aaiVpnBindingResources;
+ @Mock
+ protected AAIVpnBindingResources aaiVpnBindingResources;
- @Mock
- protected AAINetworkResources aaiNetworkResources;
+ @Mock
+ protected AAINetworkResources aaiNetworkResources;
- @Mock
- protected AAICollectionResources aaiCollectionResources;
+ @Mock
+ protected AAICollectionResources aaiCollectionResources;
- @Mock
- protected NetworkAdapterResources networkAdapterResources;
+ @Mock
+ protected NetworkAdapterResources networkAdapterResources;
- @Mock
- protected VnfAdapterVolumeGroupResources vnfAdapterVolumeGroupResources;
+ @Mock
+ protected VnfAdapterVolumeGroupResources vnfAdapterVolumeGroupResources;
- @Mock
- protected VnfAdapterVfModuleResources vnfAdapterVfModuleResources;
+ @Mock
+ protected VnfAdapterVfModuleResources vnfAdapterVfModuleResources;
- @Mock
- protected SDNCVnfResources sdncVnfResources;
+ @Mock
+ protected SDNCVnfResources sdncVnfResources;
- @Mock
- protected SDNCNetworkResources sdncNetworkResources;
+ @Mock
+ protected SDNCNetworkResources sdncNetworkResources;
- @Mock
- protected SDNCVfModuleResources sdncVfModuleResources;
+ @Mock
+ protected SDNCVfModuleResources sdncVfModuleResources;
- @Mock
- protected SDNCServiceInstanceResources sdncServiceInstanceResources;
+ @Mock
+ protected SDNCServiceInstanceResources sdncServiceInstanceResources;
- @Mock
- protected AssignNetworkBBUtils assignNetworkBBUtils;
+ @Mock
+ protected AssignNetworkBBUtils assignNetworkBBUtils;
- @Mock
- protected NetworkAdapterObjectMapper networkAdapterObjectMapper;
+ @Mock
+ protected NetworkAdapterObjectMapper networkAdapterObjectMapper;
- @Mock
- protected AAIInstanceGroupResources aaiInstanceGroupResources;
-
- @Mock
- protected NamingServiceResources namingServiceResources;
+ @Mock
+ protected AAIInstanceGroupResources aaiInstanceGroupResources;
- @Mock
- protected ApplicationControllerAction appCClient;
+ @Mock
+ protected NamingServiceResources namingServiceResources;
- @Mock
- protected CatalogDbClient catalogDbClient;
+ @Mock
+ protected ApplicationControllerAction appCClient;
- @Mock
- protected RequestsDbClient requestsDbClient;
+ @Mock
+ protected CatalogDbClient catalogDbClient;
- @Mock
- protected BBInputSetupUtils bbSetupUtils;
+ @Mock
+ protected RequestsDbClient requestsDbClient;
- @Mock
- protected BBInputSetup bbInputSetup;
+ @Mock
+ protected BBInputSetupUtils bbSetupUtils;
- @Mock
- protected AAIConfigurationResources aaiConfigurationResources;
+ @Mock
+ protected BBInputSetup bbInputSetup;
- @Mock
- protected AAIObjectMapper MOCK_aaiObjectMapper;
+ @Mock
+ protected AAIConfigurationResources aaiConfigurationResources;
- @Mock
- protected InjectionHelper MOCK_injectionHelper;
+ @Mock
+ protected AAIObjectMapper MOCK_aaiObjectMapper;
- @Mock
- protected AAIResourcesClient MOCK_aaiResourcesClient;
+ @Mock
+ protected InjectionHelper MOCK_injectionHelper;
- @Mock
- protected ExtractPojosForBB extractPojosForBB;
+ @Mock
+ protected AAIResourcesClient MOCK_aaiResourcesClient;
- @Mock
- protected ExceptionBuilder exceptionUtil;
+ @Mock
+ protected ExtractPojosForBB extractPojosForBB;
- @Mock
- protected WorkflowActionExtractResourcesAAI workflowActionUtils;
-
- @Mock
- protected Environment env;
+ @Mock
+ protected ExceptionBuilder exceptionUtil;
+
+ @Mock
+ protected WorkflowActionExtractResourcesAAI workflowActionUtils;
+
+ @Mock
+ protected Environment env;
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/aai/tasks/AAIFlagTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/aai/tasks/AAIFlagTasksTest.java
index a91ef66a29..95689e49cd 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/aai/tasks/AAIFlagTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/aai/tasks/AAIFlagTasksTest.java
@@ -28,9 +28,7 @@ import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-
import java.io.IOException;
-
import org.camunda.bpm.engine.delegate.BpmnError;
import org.junit.Before;
import org.junit.Test;
@@ -56,154 +54,173 @@ import org.springframework.beans.factory.annotation.Autowired;
public class AAIFlagTasksTest extends BaseTaskTest {
- @InjectMocks
- private AAIFlagTasks aaiFlagTasks = new AAIFlagTasks();
-
- private GenericVnf genericVnf;
-
- @Before
- public void before() throws BBObjectNotFoundException {
- genericVnf = setGenericVnf();
- doReturn(MOCK_aaiResourcesClient).when(MOCK_injectionHelper).getAaiClient();
- when(extractPojosForBB.extractByKey(any(),any())).thenReturn(genericVnf);
- }
-
- @Test
- public void checkVnfInMaintTestTrue() throws Exception {
- doThrow(new BpmnError("VNF is in maintenance in A&AI")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- doReturn(false).when(aaiVnfResources).checkInMaintFlag(isA(String.class));
- doReturn(true).when(aaiVnfResources).checkInMaintFlag(isA(String.class));
- try {
- aaiFlagTasks.checkVnfInMaintFlag(execution);
- } catch (Exception e) {
- verify(aaiVnfResources, times(1)).checkInMaintFlag(any(String.class));
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), eq("VNF is in maintenance in A&AI"));
- }
- }
-
- @Test
- public void checkVnfInMaintTestFalse() throws Exception {
- doReturn(false).when(aaiVnfResources).checkInMaintFlag(isA(String.class));
- aaiFlagTasks.checkVnfInMaintFlag(execution);
- verify(exceptionUtil, times(0)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), any(int.class), any(String.class));
- }
-
- @Test
- public void checkVnfInMaintFlagExceptionTest() {
-
- doThrow(new BpmnError("Unknown Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- doThrow(RuntimeException.class).when(aaiVnfResources).checkInMaintFlag(isA(String.class));
- try {
- aaiFlagTasks.checkVnfInMaintFlag(execution);
- } catch (Exception e) {
- verify(aaiVnfResources, times(1)).checkInMaintFlag(any(String.class));
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- }
-
- }
-
- @Test
- public void modifyVnfInMaintFlagTest() throws Exception {
- doNothing().when(aaiVnfResources).updateObjectVnf(ArgumentMatchers.any(GenericVnf.class));
- aaiFlagTasks.modifyVnfInMaintFlag(execution, true);
- verify(aaiVnfResources, times(1)).updateObjectVnf(ArgumentMatchers.any(GenericVnf.class));
- }
-
- @Test
- public void modifyVnfInMaintFlagExceptionTest() {
-
- doThrow(new BpmnError("Unknown Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- doThrow(RuntimeException.class).when(aaiVnfResources).updateObjectVnf(isA(GenericVnf.class));
- try {
- aaiFlagTasks.modifyVnfInMaintFlag(execution, true);
- } catch (Exception e) {
- verify(aaiVnfResources, times(1)).checkInMaintFlag(any(String.class));
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- }
- }
-
- @Test
- public void checkVnfClosedLoopDisabledTestTrue() throws Exception {
- doThrow(new BpmnError("VNF Closed Loop Disabled in A&AI")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- doReturn(false).when(aaiVnfResources).checkVnfClosedLoopDisabledFlag(isA(String.class));
- try {
- aaiFlagTasks.checkVnfClosedLoopDisabledFlag(execution);
- } catch (Exception e) {
- verify(aaiVnfResources, times(1)).checkVnfClosedLoopDisabledFlag(any(String.class));
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), eq("VNF Closed Loop Disabled in A&AI"));
- }
- }
-
- @Test
- public void checkVnfClosedLoopDisabledTestFalse() throws Exception {
- doReturn(false).when(aaiVnfResources).checkVnfClosedLoopDisabledFlag(isA(String.class));
- aaiFlagTasks.checkVnfClosedLoopDisabledFlag(execution);
- verify(exceptionUtil, times(0)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), any(int.class), any(String.class));
- }
-
- @Test
- public void checkVnfClosedLoopDisabledFlagExceptionTest() {
-
- doThrow(new BpmnError("Unknown Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- doThrow(RuntimeException.class).when(aaiVnfResources).checkVnfClosedLoopDisabledFlag(isA(String.class));
- try {
- aaiFlagTasks.checkVnfClosedLoopDisabledFlag(execution);
- } catch (Exception e) {
- verify(aaiVnfResources, times(1)).checkVnfClosedLoopDisabledFlag(any(String.class));
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- }
- }
-
- @Test
- public void modifyVnfClosedLoopDisabledFlagTest() throws Exception {
- doNothing().when(aaiVnfResources).updateObjectVnf(ArgumentMatchers.any(GenericVnf.class));
- aaiFlagTasks.modifyVnfClosedLoopDisabledFlag(execution, true);
- verify(aaiVnfResources, times(1)).updateObjectVnf(ArgumentMatchers.any(GenericVnf.class));
- }
-
- @Test
- public void modifyVnfClosedLoopDisabledFlagExceptionTest() {
-
- doThrow(new BpmnError("Unknown Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- doThrow(RuntimeException.class).when(aaiVnfResources).updateObjectVnf(isA(GenericVnf.class));
- try {
- aaiFlagTasks.modifyVnfClosedLoopDisabledFlag(execution, true);
- } catch (Exception e) {
- verify(aaiVnfResources, times(1)).checkVnfClosedLoopDisabledFlag(any(String.class));
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- }
- }
-
-
- @Test
- public void checkVnfPserversLockedFlagTestTrue() throws Exception {
- doThrow(new BpmnError("VNF PServers in Locked in A&AI")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- doReturn(true).when(aaiVnfResources).checkVnfPserversLockedFlag(isA(String.class));
- try {
- aaiFlagTasks.checkVnfClosedLoopDisabledFlag(execution);
- } catch (Exception e) {
- verify(aaiVnfResources, times(1)).checkVnfPserversLockedFlag(any(String.class));
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), eq("VNF PServers in Locked in A&AI"));
- }
- }
-
- @Test
- public void checkVnfPserversLockedFlagTestFalse() throws Exception {
- doReturn(false).when(aaiVnfResources).checkVnfPserversLockedFlag(isA(String.class));
- aaiFlagTasks.checkVnfPserversLockedFlag(execution);
- verify(exceptionUtil, times(0)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), any(int.class), any(String.class));
- }
-
- @Test
- public void checkVnfPserversLockedFlagExceptionTest() throws IOException {
-
- doThrow(new BpmnError("Unknown Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- doThrow(RuntimeException.class).when(aaiVnfResources).checkVnfClosedLoopDisabledFlag(isA(String.class));
- try {
- aaiFlagTasks.checkVnfPserversLockedFlag(execution);
- } catch (Exception e) {
- verify(aaiVnfResources, times(1)).checkVnfPserversLockedFlag(any(String.class));
- verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
- }
- }
+ @InjectMocks
+ private AAIFlagTasks aaiFlagTasks = new AAIFlagTasks();
+
+ private GenericVnf genericVnf;
+
+ @Before
+ public void before() throws BBObjectNotFoundException {
+ genericVnf = setGenericVnf();
+ doReturn(MOCK_aaiResourcesClient).when(MOCK_injectionHelper).getAaiClient();
+ when(extractPojosForBB.extractByKey(any(), any())).thenReturn(genericVnf);
+ }
+
+ @Test
+ public void checkVnfInMaintTestTrue() throws Exception {
+ doThrow(new BpmnError("VNF is in maintenance in A&AI")).when(exceptionUtil)
+ .buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
+ doReturn(false).when(aaiVnfResources).checkInMaintFlag(isA(String.class));
+ doReturn(true).when(aaiVnfResources).checkInMaintFlag(isA(String.class));
+ try {
+ aaiFlagTasks.checkVnfInMaintFlag(execution);
+ } catch (Exception e) {
+ verify(aaiVnfResources, times(1)).checkInMaintFlag(any(String.class));
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000),
+ eq("VNF is in maintenance in A&AI"));
+ }
+ }
+
+ @Test
+ public void checkVnfInMaintTestFalse() throws Exception {
+ doReturn(false).when(aaiVnfResources).checkInMaintFlag(isA(String.class));
+ aaiFlagTasks.checkVnfInMaintFlag(execution);
+ verify(exceptionUtil, times(0)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class),
+ any(int.class), any(String.class));
+ }
+
+ @Test
+ public void checkVnfInMaintFlagExceptionTest() {
+
+ doThrow(new BpmnError("Unknown Error")).when(exceptionUtil)
+ .buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
+ doThrow(RuntimeException.class).when(aaiVnfResources).checkInMaintFlag(isA(String.class));
+ try {
+ aaiFlagTasks.checkVnfInMaintFlag(execution);
+ } catch (Exception e) {
+ verify(aaiVnfResources, times(1)).checkInMaintFlag(any(String.class));
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000),
+ any(String.class));
+ }
+
+ }
+
+ @Test
+ public void modifyVnfInMaintFlagTest() throws Exception {
+ doNothing().when(aaiVnfResources).updateObjectVnf(ArgumentMatchers.any(GenericVnf.class));
+ aaiFlagTasks.modifyVnfInMaintFlag(execution, true);
+ verify(aaiVnfResources, times(1)).updateObjectVnf(ArgumentMatchers.any(GenericVnf.class));
+ }
+
+ @Test
+ public void modifyVnfInMaintFlagExceptionTest() {
+
+ doThrow(new BpmnError("Unknown Error")).when(exceptionUtil)
+ .buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
+ doThrow(RuntimeException.class).when(aaiVnfResources).updateObjectVnf(isA(GenericVnf.class));
+ try {
+ aaiFlagTasks.modifyVnfInMaintFlag(execution, true);
+ } catch (Exception e) {
+ verify(aaiVnfResources, times(1)).checkInMaintFlag(any(String.class));
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000),
+ any(String.class));
+ }
+ }
+
+ @Test
+ public void checkVnfClosedLoopDisabledTestTrue() throws Exception {
+ doThrow(new BpmnError("VNF Closed Loop Disabled in A&AI")).when(exceptionUtil)
+ .buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
+ doReturn(false).when(aaiVnfResources).checkVnfClosedLoopDisabledFlag(isA(String.class));
+ try {
+ aaiFlagTasks.checkVnfClosedLoopDisabledFlag(execution);
+ } catch (Exception e) {
+ verify(aaiVnfResources, times(1)).checkVnfClosedLoopDisabledFlag(any(String.class));
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000),
+ eq("VNF Closed Loop Disabled in A&AI"));
+ }
+ }
+
+ @Test
+ public void checkVnfClosedLoopDisabledTestFalse() throws Exception {
+ doReturn(false).when(aaiVnfResources).checkVnfClosedLoopDisabledFlag(isA(String.class));
+ aaiFlagTasks.checkVnfClosedLoopDisabledFlag(execution);
+ verify(exceptionUtil, times(0)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class),
+ any(int.class), any(String.class));
+ }
+
+ @Test
+ public void checkVnfClosedLoopDisabledFlagExceptionTest() {
+
+ doThrow(new BpmnError("Unknown Error")).when(exceptionUtil)
+ .buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
+ doThrow(RuntimeException.class).when(aaiVnfResources).checkVnfClosedLoopDisabledFlag(isA(String.class));
+ try {
+ aaiFlagTasks.checkVnfClosedLoopDisabledFlag(execution);
+ } catch (Exception e) {
+ verify(aaiVnfResources, times(1)).checkVnfClosedLoopDisabledFlag(any(String.class));
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000),
+ any(String.class));
+ }
+ }
+
+ @Test
+ public void modifyVnfClosedLoopDisabledFlagTest() throws Exception {
+ doNothing().when(aaiVnfResources).updateObjectVnf(ArgumentMatchers.any(GenericVnf.class));
+ aaiFlagTasks.modifyVnfClosedLoopDisabledFlag(execution, true);
+ verify(aaiVnfResources, times(1)).updateObjectVnf(ArgumentMatchers.any(GenericVnf.class));
+ }
+
+ @Test
+ public void modifyVnfClosedLoopDisabledFlagExceptionTest() {
+
+ doThrow(new BpmnError("Unknown Error")).when(exceptionUtil)
+ .buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
+ doThrow(RuntimeException.class).when(aaiVnfResources).updateObjectVnf(isA(GenericVnf.class));
+ try {
+ aaiFlagTasks.modifyVnfClosedLoopDisabledFlag(execution, true);
+ } catch (Exception e) {
+ verify(aaiVnfResources, times(1)).checkVnfClosedLoopDisabledFlag(any(String.class));
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000),
+ any(String.class));
+ }
+ }
+
+
+ @Test
+ public void checkVnfPserversLockedFlagTestTrue() throws Exception {
+ doThrow(new BpmnError("VNF PServers in Locked in A&AI")).when(exceptionUtil)
+ .buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
+ doReturn(true).when(aaiVnfResources).checkVnfPserversLockedFlag(isA(String.class));
+ try {
+ aaiFlagTasks.checkVnfClosedLoopDisabledFlag(execution);
+ } catch (Exception e) {
+ verify(aaiVnfResources, times(1)).checkVnfPserversLockedFlag(any(String.class));
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000),
+ eq("VNF PServers in Locked in A&AI"));
+ }
+ }
+
+ @Test
+ public void checkVnfPserversLockedFlagTestFalse() throws Exception {
+ doReturn(false).when(aaiVnfResources).checkVnfPserversLockedFlag(isA(String.class));
+ aaiFlagTasks.checkVnfPserversLockedFlag(execution);
+ verify(exceptionUtil, times(0)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class),
+ any(int.class), any(String.class));
+ }
+
+ @Test
+ public void checkVnfPserversLockedFlagExceptionTest() throws IOException {
+
+ doThrow(new BpmnError("Unknown Error")).when(exceptionUtil)
+ .buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(String.class));
+ doThrow(RuntimeException.class).when(aaiVnfResources).checkVnfClosedLoopDisabledFlag(isA(String.class));
+ try {
+ aaiFlagTasks.checkVnfPserversLockedFlag(execution);
+ } catch (Exception e) {
+ verify(aaiVnfResources, times(1)).checkVnfPserversLockedFlag(any(String.class));
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000),
+ any(String.class));
+ }
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
index 8bbb6c7f46..ff6426d351 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
@@ -21,14 +21,12 @@ package org.onap.so.bpmn.common.data;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
-
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl;
import org.junit.Before;
@@ -75,540 +73,543 @@ import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-public class TestDataSetup{
- private int collectionCounter;
- private int configurationCounter;
- private int customerCounter;
- private int genericVnfCounter;
- private int instanceGroupCounter;
- private int l3NetworkCounter;
- private int owningEntityCounter;
- private int pnfCounter;
- private int projectCounter;
- private int serviceInstanceCounter;
- private int serviceProxyCounter;
- private int serviceSubscriptionCounter;
- private int vfModuleCounter;
- private int volumeGroupCounter;
- private int vpnBindingCounter;
- private int vpnBondingLinkCounter;
-
- protected BuildingBlockExecution execution;
-
- protected GeneralBuildingBlock gBBInput;
-
- protected HashMap lookupKeyMap;
-
- protected ExtractPojosForBB extractPojosForBB = new ExtractPojosForBB();
-
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
- protected DelegateExecution delegateExecution;
-
- @Before
- public void buildingBlockTestDataSetupBefore() {
- collectionCounter = 0;
- configurationCounter = 0;
- customerCounter = 0;
- genericVnfCounter = 0;
- instanceGroupCounter = 0;
- l3NetworkCounter = 0;
- owningEntityCounter = 0;
- pnfCounter = 0;
- projectCounter = 0;
- serviceInstanceCounter = 0;
- serviceProxyCounter = 0;
- serviceSubscriptionCounter = 0;
- vfModuleCounter = 0;
- volumeGroupCounter = 0;
- vpnBindingCounter = 0;
- vpnBondingLinkCounter = 0;
-
- execution = new DelegateExecutionImpl(new ExecutionImpl());
- execution.setVariable("testProcessKey", "testProcessKeyValue");
-
- gBBInput = new GeneralBuildingBlock();
- execution.setVariable("gBBInput", gBBInput);
-
- lookupKeyMap = new HashMap();
- execution.setVariable("lookupKeyMap", lookupKeyMap);
-
- ExecutionImpl mockExecutionImpl = mock(ExecutionImpl.class);
- doReturn("test").when(mockExecutionImpl).getProcessInstanceId();
-
- ExecutionImpl executionImpl = new ExecutionImpl();
- executionImpl.setProcessInstance(mockExecutionImpl);
-
- delegateExecution = (DelegateExecution) executionImpl;
- delegateExecution.setVariable("testProcessKey", "testProcessKeyValue");
- }
-
- public Map buildUserInput() {
- Map userInput = new HashMap<>();
- userInput.put("testUserInputKey", "testUserInputValue");
-
- return userInput;
- }
-
- public Map setUserInput() {
- Map userInput = buildUserInput();
-
- gBBInput.setUserInput(userInput);
-
- return userInput;
- }
-
- public RequestContext buildRequestContext() {
- RequestContext requestContext = new RequestContext();
- requestContext.setMsoRequestId(UUID.randomUUID().toString());
- requestContext.setProductFamilyId("testProductFamilyId");
- requestContext.setRequestorId("testRequestorId");
-
- requestContext.setUserParams(new HashMap<>());
-
- Map dataMap = new HashMap<>();
- dataMap.put("vpnId","testVpnId");
- dataMap.put("vpnRegion","testVpnRegion");
- dataMap.put("vpnRt","testVpnRt");
- dataMap.put("vpnName","vpnName");
+public class TestDataSetup {
+ private int collectionCounter;
+ private int configurationCounter;
+ private int customerCounter;
+ private int genericVnfCounter;
+ private int instanceGroupCounter;
+ private int l3NetworkCounter;
+ private int owningEntityCounter;
+ private int pnfCounter;
+ private int projectCounter;
+ private int serviceInstanceCounter;
+ private int serviceProxyCounter;
+ private int serviceSubscriptionCounter;
+ private int vfModuleCounter;
+ private int volumeGroupCounter;
+ private int vpnBindingCounter;
+ private int vpnBondingLinkCounter;
+
+ protected BuildingBlockExecution execution;
+
+ protected GeneralBuildingBlock gBBInput;
+
+ protected HashMap lookupKeyMap;
+
+ protected ExtractPojosForBB extractPojosForBB = new ExtractPojosForBB();
+
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
+
+ protected DelegateExecution delegateExecution;
+
+ @Before
+ public void buildingBlockTestDataSetupBefore() {
+ collectionCounter = 0;
+ configurationCounter = 0;
+ customerCounter = 0;
+ genericVnfCounter = 0;
+ instanceGroupCounter = 0;
+ l3NetworkCounter = 0;
+ owningEntityCounter = 0;
+ pnfCounter = 0;
+ projectCounter = 0;
+ serviceInstanceCounter = 0;
+ serviceProxyCounter = 0;
+ serviceSubscriptionCounter = 0;
+ vfModuleCounter = 0;
+ volumeGroupCounter = 0;
+ vpnBindingCounter = 0;
+ vpnBondingLinkCounter = 0;
+
+ execution = new DelegateExecutionImpl(new ExecutionImpl());
+ execution.setVariable("testProcessKey", "testProcessKeyValue");
+
+ gBBInput = new GeneralBuildingBlock();
+ execution.setVariable("gBBInput", gBBInput);
+
+ lookupKeyMap = new HashMap();
+ execution.setVariable("lookupKeyMap", lookupKeyMap);
+
+ ExecutionImpl mockExecutionImpl = mock(ExecutionImpl.class);
+ doReturn("test").when(mockExecutionImpl).getProcessInstanceId();
+
+ ExecutionImpl executionImpl = new ExecutionImpl();
+ executionImpl.setProcessInstance(mockExecutionImpl);
+
+ delegateExecution = (DelegateExecution) executionImpl;
+ delegateExecution.setVariable("testProcessKey", "testProcessKeyValue");
+ }
+
+ public Map buildUserInput() {
+ Map userInput = new HashMap<>();
+ userInput.put("testUserInputKey", "testUserInputValue");
+
+ return userInput;
+ }
+
+ public Map setUserInput() {
+ Map userInput = buildUserInput();
+
+ gBBInput.setUserInput(userInput);
+
+ return userInput;
+ }
+
+ public RequestContext buildRequestContext() {
+ RequestContext requestContext = new RequestContext();
+ requestContext.setMsoRequestId(UUID.randomUUID().toString());
+ requestContext.setProductFamilyId("testProductFamilyId");
+ requestContext.setRequestorId("testRequestorId");
+
+ requestContext.setUserParams(new HashMap<>());
+
+ Map dataMap = new HashMap<>();
+ dataMap.put("vpnId", "testVpnId");
+ dataMap.put("vpnRegion", "testVpnRegion");
+ dataMap.put("vpnRt", "testVpnRt");
+ dataMap.put("vpnName", "vpnName");
dataMap.put("vpnRegion", Arrays.asList(new String[] {"USA", "EMEA", "APAC"}));
- HashMap userParams = new HashMap<>();
- userParams.put("vpnData",dataMap);
+ HashMap userParams = new HashMap<>();
+ userParams.put("vpnData", dataMap);
+
+ List