From 7ace3e6761629e84f357d4bea06fbf539039d218 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Sat, 17 Nov 2018 00:52:11 -0500 Subject: Use spring auto deployment remove processes.xml from application in favor of spring properties removed the last @EnableProcessApplication annotation removed remaining processes.xml from code modified JEL expression with explicit getVariable calls update application.yaml defaults for camunda deployment Update camunda configuration to run history clean up Change-Id: If9a5cf03a8cdc33c32eeb790656f925d2f0b6d7b Issue-ID: SO-1232 Signed-off-by: Benjamin, Max (mb388a) --- .../MSOInfrastructureApplication.java | 3 - .../src/main/resources/META-INF/processes.xml | 31 ---------- .../src/main/resources/application.yaml | 8 +++ .../pnf/delegate/AaiConnectionTestImpl.java | 10 +++- .../delegate/CreateAndActivatePnfResourceTest.java | 20 +------ .../pnf/delegate/DmaapClientTestImpl.java | 8 ++- .../src/test/resources/application-test.yaml | 21 ++++++- .../resources/applicationContext_forPnfTesting.xml | 68 ---------------------- 8 files changed, 43 insertions(+), 126 deletions(-) delete mode 100644 bpmn/mso-infrastructure-bpmn/src/main/resources/META-INF/processes.xml delete mode 100644 bpmn/mso-infrastructure-bpmn/src/test/resources/applicationContext_forPnfTesting.xml (limited to 'bpmn/mso-infrastructure-bpmn/src') 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 @@ - - - - - - - - false - true - - - - 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 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit 1.2.3-korg