aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/mso-infrastructure-bpmn/src/test
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-11-28 14:42:12 +0000
committerGerrit Code Review <gerrit@onap.org>2018-11-28 14:42:12 +0000
commitb9264cfc0c81ac25416268956c4ab389fdf0fcf6 (patch)
tree490ffa4f7d0fd51deab7c817cedfa6bace8e4ead /bpmn/mso-infrastructure-bpmn/src/test
parent2c480ac2fc537c669d64f0a3d62c5286ba6dce74 (diff)
parent7ace3e6761629e84f357d4bea06fbf539039d218 (diff)
Merge "Use spring auto deployment"
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn/src/test')
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java10
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java20
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java8
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml21
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/resources/applicationContext_forPnfTesting.xml68
5 files changed, 35 insertions, 92 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java
index 201e791a24..70d94052e1 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java
@@ -20,15 +20,19 @@
package org.onap.so.bpmn.infrastructure.pnf.delegate;
-import org.onap.aai.domain.yang.Pnf;
-import org.onap.so.bpmn.infrastructure.pnf.implementation.AaiConnection;
-
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
+import org.onap.aai.domain.yang.Pnf;
+import org.onap.so.bpmn.infrastructure.pnf.implementation.AaiConnection;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Component;
+
+@Component
+@Primary
public class AaiConnectionTestImpl implements AaiConnection {
public static final String ID_WITHOUT_ENTRY = "IdWithoutEntry";
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java
index 6c174ae537..74e5a6c964 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java
@@ -27,28 +27,14 @@ import java.util.HashMap;
import java.util.Map;
import org.assertj.core.api.Assertions;
-import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.camunda.bpm.engine.test.Deployment;
-import org.camunda.bpm.engine.test.ProcessEngineRule;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.onap.so.BaseIntegrationTest;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringRunner;
-@RunWith(SpringRunner.class)
-@ContextConfiguration(locations = "/applicationContext_forPnfTesting.xml")
-public class CreateAndActivatePnfResourceTest {
+public class CreateAndActivatePnfResourceTest extends BaseIntegrationTest {
private static final String TIMEOUT_10_S = "PT10S";
- @Autowired
- private RuntimeService runtimeService;
-
- @Autowired
- @Rule
- public ProcessEngineRule processEngineRule;
@Autowired
private AaiConnectionTestImpl aaiConnection;
@@ -57,7 +43,6 @@ public class CreateAndActivatePnfResourceTest {
private DmaapClientTestImpl dmaapClientTestImpl;
@Test
- @Deployment(resources = {"process/CreateAndActivatePnfResource.bpmn"})
public void shouldWaitForMessageFromDmaapAndUpdateAaiEntryWhenAaiEntryExists() {
// given
aaiConnection.reset();
@@ -84,7 +69,6 @@ public class CreateAndActivatePnfResourceTest {
}
@Test
- @Deployment(resources = {"process/CreateAndActivatePnfResource.bpmn"})
public void shouldCreateAaiEntryWaitForMessageFromDmaapAndUpdateAaiEntryWhenNoAaiEntryExists() {
// given
aaiConnection.reset();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
index 09fb2d4cd7..146e07b820 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java
@@ -20,10 +20,14 @@
package org.onap.so.bpmn.infrastructure.pnf.delegate;
-import org.onap.so.bpmn.infrastructure.pnf.dmaap.DmaapClient;
-
import java.util.Objects;
+import org.onap.so.bpmn.infrastructure.pnf.dmaap.DmaapClient;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Component;
+
+@Component
+@Primary
public class DmaapClientTestImpl implements DmaapClient {
private String correlationId;
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 0ffe16380f..efabdb147a 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml
+++ b/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml
@@ -1,6 +1,7 @@
aai:
auth: 5A1272FE739BECA4D4374A86B25C021DFE6745E3BB7BE6836BF64A6059B8220E586C21FD7567AF41DB42571EB7
endpoint: http://localhost:${wiremock.server.port}
+ pnfEntryNotificationTimeout: P14D
appc:
client:
key: iaEMAfjsVsZnraBP
@@ -55,7 +56,9 @@ mso:
workflow:
message:
endpoint: http://localhost:${wiremock.server.port}/workflows/messages/message
-
+ requestDb:
+ auth: Basic YnBlbDptc28tZGItMTUwNyE=
+ endpoint: http://localhost:8081
async:
core-pool-size: 50
max-pool-size: 50
@@ -206,3 +209,19 @@ camunda:
metrics:
enabled: false
db-reporter-activate: false
+ application:
+ delete-upon-undeploy: false
+ scan-for-process-definitions: true
+ deploy-changed-only: true
+ job-execution:
+ deployment-aware: true
+pnf:
+ dmaap:
+ host: hostTest
+ port: 1234
+ protocol: http
+ uriPathPrefix: events
+ topicName: pnfReady
+ consumerGroup: consumerGroup
+ consumerId: consumerId
+ topicListenerDelayInSeconds: 5
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/resources/applicationContext_forPnfTesting.xml b/bpmn/mso-infrastructure-bpmn/src/test/resources/applicationContext_forPnfTesting.xml
deleted file mode 100644
index 3a41801d4a..0000000000
--- a/bpmn/mso-infrastructure-bpmn/src/test/resources/applicationContext_forPnfTesting.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-2.5.xsd" >
-
- <bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
- <property name="targetDataSource">
- <bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
- <property name="driverClass" value="org.h2.Driver" />
- <property name="url"
- value="jdbc:h2:mem:process-engine;DB_CLOSE_DELAY=1000" />
- <property name="username" value="sa" />
- <property name="password" value="" />
- </bean>
- </property>
- </bean>
-
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="dataSource" />
- </bean>
-
- <bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
- <property name="processEngineName" value="engine" />
- <property name="dataSource" ref="dataSource" />
- <property name="transactionManager" ref="transactionManager" />
- <property name="databaseSchemaUpdate" value="true" />
- <property name="jobExecutorActivate" value="false" />
- </bean>
-
- <bean id="processEngine" class="org.camunda.bpm.engine.spring.ProcessEngineFactoryBean">
- <property name="processEngineConfiguration" ref="processEngineConfiguration" />
- </bean>
-
- <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
- <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
- <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
- <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
- <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
-
- <context:annotation-config />
-
- <bean id="processEngineRule" class="org.camunda.bpm.engine.test.ProcessEngineRule">
- <property name="processEngine" ref="processEngine" />
- </bean>
-
- <bean id="aaiConnection" class="org.onap.so.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl"/>
-
- <bean id="CheckAaiForCorrelationIdDelegate" class="org.onap.so.bpmn.infrastructure.pnf.delegate.CheckAaiForCorrelationIdDelegate">
- <property name="aaiConnection" ref="aaiConnection"/>
- </bean>
-
- <bean id="CreateAaiEntryWithPnfIdDelegate" class="org.onap.so.bpmn.infrastructure.pnf.delegate.CreateAaiEntryWithPnfIdDelegate">
- <property name="aaiConnection" ref="aaiConnection"/>
- </bean>
-
- <bean id="InformDmaapClient" class="org.onap.so.bpmn.infrastructure.pnf.delegate.InformDmaapClient">
- <property name="dmaapClient" ref="DmaapClient"/>
- </bean>
-
- <bean id="DmaapClient" class="org.onap.so.bpmn.infrastructure.pnf.delegate.DmaapClientTestImpl"/>
-
- <bean id="PnfCheckInputs" class="org.onap.so.bpmn.infrastructure.pnf.delegate.PnfCheckInputs">
- <constructor-arg value="PT1S"></constructor-arg>
- </bean>
-</beans>