diff options
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn')
9 files changed, 72 insertions, 126 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/pom.xml b/bpmn/mso-infrastructure-bpmn/pom.xml index e3d611275e..e22125bee6 100644 --- a/bpmn/mso-infrastructure-bpmn/pom.xml +++ b/bpmn/mso-infrastructure-bpmn/pom.xml @@ -20,6 +20,7 @@ <goal>unpack</goal> </goals> <configuration> + <skip>true</skip> <artifactItems> <artifactItem> <groupId>org.onap.so</groupId> @@ -55,6 +56,24 @@ </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <executions> + <execution> + <id>integration-test</id> + <goals> + <goal>test</goal> + </goals> + <configuration> + <skip>true</skip> + <includes> + <include>**/IntegrationTestSuite.java</include> + </includes> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <executions> <execution> @@ -176,6 +195,16 @@ <scope>test</scope> </dependency> <dependency> + <groupId>org.onap.so</groupId> + <artifactId>so-bpmn-building-blocks</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so</groupId> + <artifactId>so-bpmn-infrastructure-flows</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> </dependency> diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java index efd73ba4f2..7956ecc363 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java @@ -27,11 +27,9 @@ import org.camunda.bpm.application.PostDeploy; import org.camunda.bpm.application.PreUndeploy; import org.camunda.bpm.application.ProcessApplicationInfo; import org.camunda.bpm.engine.ProcessEngine; -import org.camunda.bpm.spring.boot.starter.annotation.EnableProcessApplication; import org.onap.so.bpmn.common.DefaultToShortClassNameBeanNameGenerator; import org.onap.so.logger.MsoLogger; import org.onap.so.logging.jaxrs.filter.MDCTaskDecorator; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -49,7 +47,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; */ @SpringBootApplication -@EnableProcessApplication("MSO Infrastructure Application") @EnableAsync @ComponentScan(basePackages = { "org.onap" }, nameGenerator = DefaultToShortClassNameBeanNameGenerator.class, excludeFilters = { @Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class) }) diff --git a/bpmn/mso-infrastructure-bpmn/src/main/resources/META-INF/processes.xml b/bpmn/mso-infrastructure-bpmn/src/main/resources/META-INF/processes.xml deleted file mode 100644 index 35235b8539..0000000000 --- a/bpmn/mso-infrastructure-bpmn/src/main/resources/META-INF/processes.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!-- - ============LICENSE_START======================================================= - ONAP SO - ================================================================================ - 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 - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ============LICENSE_END========================================================= - --> - -<process-application - xmlns="http://www.camunda.org/schema/1.0/ProcessApplication" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <process-archive name="att-services-bpmn"> - <properties> - <property name="isDeleteUponUndeploy">false</property> - <property name="isScanForProcessDefinitions">true</property> - </properties> - </process-archive> - -</process-application> diff --git a/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml b/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml index c6a9f88487..2515603e82 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml +++ b/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml @@ -14,6 +14,14 @@ spring: enabled: false jersey: application-path: /sobpmnengine +camunda: + bpm: + application: + delete-upon-undeploy: false + scan-for-process-definitions: true + deploy-changed-only: true + job-execution: + deployment-aware: true #Actuator management: context-path: /manage 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> |