diff options
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn')
10 files changed, 62 insertions, 42 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/pom.xml b/bpmn/mso-infrastructure-bpmn/pom.xml index b410a2d405..9f5dabe2f2 100644 --- a/bpmn/mso-infrastructure-bpmn/pom.xml +++ b/bpmn/mso-infrastructure-bpmn/pom.xml @@ -132,12 +132,17 @@ <dependency> <groupId>org.camunda.bpm.springboot</groupId> <artifactId>camunda-bpm-spring-boot-starter</artifactId> - <version>2.3.0</version> + <version>${camunda.springboot.version}</version> + </dependency> + <dependency> + <groupId>org.camunda.bpm.springboot</groupId> + <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId> + <version>${camunda.springboot.version}</version> </dependency> <dependency> <groupId>org.camunda.bpm.springboot</groupId> <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId> - <version>2.3.0</version> + <version>${camunda.springboot.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> @@ -188,13 +193,11 @@ </dependency> <dependency> <groupId>io.micrometer</groupId> - <artifactId>micrometer-spring-legacy</artifactId> - <version>1.0.5</version> + <artifactId>micrometer-core</artifactId> </dependency> <dependency> <groupId>io.micrometer</groupId> - <artifactId>micrometer-registry-prometheus</artifactId> - <version>1.0.5</version> + <artifactId>micrometer-registry-prometheus</artifactId> </dependency> <dependency> <groupId>org.onap.so</groupId> @@ -206,5 +209,23 @@ <artifactId>cxf-logging</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>org.camunda.bpm.extension.mockito</groupId> + <artifactId>camunda-bpm-mockito</artifactId> + <version>3.2.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.camunda.bpm.extension</groupId> + <artifactId>camunda-bpm-assert</artifactId> + <version>1.2</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.assertj</groupId> + <artifactId>assertj-core</artifactId> + <version>1.7.0</version> + <scope>test</scope> + </dependency> </dependencies> </project> diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java index 9b65cca6c9..5435194f39 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java @@ -196,6 +196,7 @@ public class LoggingAndURNMappingPlugin extends AbstractProcessEnginePlugin { @Override public void parseSequenceFlow(Element sequenceFlowElement, ScopeImpl scopeElement, TransitionImpl transition) { + //injectLogExecutionListener(activity); } @Override @@ -213,7 +214,7 @@ public class LoggingAndURNMappingPlugin extends AbstractProcessEnginePlugin { injectLogExecutionListener(timerActivity); } - @Override + @Override public void parseRootElement(Element rootElement, List<ProcessDefinitionEntity> processDefinitions) { } @@ -307,7 +308,8 @@ public class LoggingAndURNMappingPlugin extends AbstractProcessEnginePlugin { String processName = repositoryService.createProcessDefinitionQuery() .processDefinitionId(execution.getProcessDefinitionId()) .singleResult() - .getName(); + .getName(); + MsoLogger.setServiceName(processName); String requestId = (String) execution.getVariable("mso-request-id"); diff --git a/bpmn/mso-infrastructure-bpmn/src/main/resources/application-local.yml b/bpmn/mso-infrastructure-bpmn/src/main/resources/application-local.yml index 911aabdaec..ccea9483a8 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/resources/application-local.yml +++ b/bpmn/mso-infrastructure-bpmn/src/main/resources/application-local.yml @@ -1,5 +1,5 @@ aai: - auth: asdf + auth: D6F77EC78213EF2AA1685F7F05E4DE7C0D1A70AA8798EC68B691CEF81E9991E4A0A3DA4F70EC61C5EB6525134E dme2: timeout: '30000' endpoint: http://localhost:8443 @@ -38,7 +38,7 @@ mso: completemsoprocess: endpoint: http://localhost:30253/CompleteMsoProcess db: - auth: 26AFB797A6A57960D5D718491925C50F77CDC22AC394B3DBA09950D8FD1C0764 + auth: 5A1272FE739BECA4D4374A86B25C021DFE6745E3BB7BE6836BF64A6059B8220E586C21FD7567AF41DB42571EB7 password: wLg4sjrAFUS8rfVfdvTXeQ== endpoint: http://localhost:30257/services/RequestsDbAdapter spring: @@ -51,7 +51,7 @@ mso: db: endpoint: http://localhost:30257/services/RequestsDbAdapter po: - auth: 757A94191D685FD2092AC1490730A4FC + auth: 5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C password: 3141634BF7E070AA289CF2892C986C0B sdnc: endpoint: http://localhost:30254/adapters/SDNCAdapter diff --git a/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml b/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml index c1f58e9db0..c6a9f88487 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml +++ b/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml @@ -6,14 +6,9 @@ server: spring: datasource: driver-class-name: org.mariadb.jdbc.Driver - url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/camundabpmn + jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/camundabpmn username: ${DB_USERNAME} password: ${DB_PASSWORD} - dbcp2: - initial-size: 5 - max-total: 20 - validation-query: select 1 - test-on-borrow: true http: multipart: enabled: false diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/InfraEmbeddedMariaDbConfig.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/InfraEmbeddedMariaDbConfig.java index eee2810125..c28a86c49a 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/InfraEmbeddedMariaDbConfig.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/InfraEmbeddedMariaDbConfig.java @@ -24,7 +24,7 @@ import ch.vorburger.mariadb4j.DBConfigurationBuilder; import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; +import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java index 041afe398b..335f3468a7 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java @@ -927,6 +927,11 @@ public abstract class WorkflowTest { protected boolean injectSDNCRestCallback(String contentType, String content, long timeout) { String sdncRequestId = (String) getProcessVariable("SDNCAdapterRestV1", "SDNCAResponse_CORRELATOR", timeout); + + if (sdncRequestId == null) { + sdncRequestId = (String) getProcessVariable("SDNCAdapterRestV2", + "SDNCAResponse_CORRELATOR", timeout); + } if (sdncRequestId == null) { return false; @@ -1688,7 +1693,7 @@ public abstract class WorkflowTest { /** * Checks to see if the specified process is ended. -<<<<<<< HEAD:bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java + * * @param processInstanceId the process Instance Id * @return true if the process is ended */ @@ -1700,8 +1705,7 @@ public abstract class WorkflowTest { /** * Checks to see if the specified process is ended. -======= ->>>>>>> origin/release/1806.51:bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java + * * @author cb645j */ //TODO combine into 1 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 2348af5dec..489b1a5761 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 @@ -20,13 +20,17 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate; +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; + +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.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions; -import org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,11 +38,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; -import java.util.HashMap; -import java.util.Map; - -import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; - @RunWith(SpringRunner.class) @ContextConfiguration(locations = "/applicationContext_forPnfTesting.xml") public class CreateAndActivatePnfResourceTest { @@ -61,19 +60,18 @@ public class CreateAndActivatePnfResourceTest { @Deployment(resources = {"process/CreateAndActivatePnfResource.bpmn"}) public void shouldWaitForMessageFromDmaapAndUpdateAaiEntryWhenAaiEntryExists() { // given - aaiConnection.reset(); - BpmnAwareTests.init(processEngineRule.getProcessEngine()); + aaiConnection.reset(); Map<String, Object> variables = new HashMap<>(); variables.put("timeoutForPnfEntryNotification", TIMEOUT_10_S); variables.put(CORRELATION_ID, AaiConnectionTestImpl.ID_WITH_ENTRY); // when ProcessInstance instance = runtimeService .startProcessInstanceByKey("CreateAndActivatePnfResource", "businessKey", variables); - BpmnAwareAssertions.assertThat(instance).isWaitingAt("WaitForDmaapPnfReadyNotification").isWaitingFor("WorkflowMessage"); + assertThat(instance).isWaitingAt("WaitForDmaapPnfReadyNotification").isWaitingFor("WorkflowMessage"); dmaapClientTestImpl.sendMessage(); // then - BpmnAwareAssertions.assertThat(instance).isEnded().hasPassedInOrder( + assertThat(instance).isEnded().hasPassedInOrder( "CreateAndActivatePnf_StartEvent", "CheckInputs", "CheckAiiForCorrelationId", @@ -90,18 +88,18 @@ public class CreateAndActivatePnfResourceTest { public void shouldCreateAaiEntryWaitForMessageFromDmaapAndUpdateAaiEntryWhenNoAaiEntryExists() { // given aaiConnection.reset(); - BpmnAwareTests.init(processEngineRule.getProcessEngine()); + Map<String, Object> variables = new HashMap<>(); variables.put("timeoutForPnfEntryNotification", TIMEOUT_10_S); variables.put(CORRELATION_ID, AaiConnectionTestImpl.ID_WITHOUT_ENTRY); // when ProcessInstance instance = runtimeService .startProcessInstanceByKey("CreateAndActivatePnfResource", "businessKey", variables); - BpmnAwareAssertions.assertThat(instance).isWaitingAt("WaitForDmaapPnfReadyNotification").isWaitingFor("WorkflowMessage"); + assertThat(instance).isWaitingAt("WaitForDmaapPnfReadyNotification").isWaitingFor("WorkflowMessage"); dmaapClientTestImpl.sendMessage(); // then - BpmnAwareAssertions.assertThat(instance).isEnded().hasPassedInOrder( + assertThat(instance).isEnded().hasPassedInOrder( "CreateAndActivatePnf_StartEvent", "CheckInputs", "CheckAiiForCorrelationId", diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackIT.java index 5b78b485a9..a19dec1f98 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackIT.java @@ -309,7 +309,7 @@ public class DoCreateAllottedResourceBRGRollbackIT extends AbstractTestBase { rollbackData.put(RbType, "rollbackSDNCassign", "true"); rollbackData.put(RbType, "rollbackSDNCactivate", "true"); rollbackData.put(RbType, "rollbackSDNCcreate", "true"); - rollbackData.put(RbType, "aaiARPath", "http://localhost:"+wiremockPort+"/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID); + rollbackData.put(RbType, "aaiARPath", "business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID); rollbackData.put(RbType, "sdncActivateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncActivateRollbackReq.xml")); rollbackData.put(RbType, "sdncCreateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncCreateRollbackReq.xml")); diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackIT.java index 3720f1d840..8b47174b3b 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackIT.java @@ -309,7 +309,7 @@ public class DoCreateAllottedResourceTXCRollbackIT extends AbstractTestBase { rollbackData.put(RbType, "rollbackSDNCassign", "true"); rollbackData.put(RbType, "rollbackSDNCactivate", "true"); rollbackData.put(RbType, "rollbackSDNCcreate", "true"); - rollbackData.put(RbType, "aaiARPath", "http://localhost:"+wiremockPort+"/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID); + rollbackData.put(RbType, "aaiARPath", "/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID); rollbackData.put(RbType, "sdncActivateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncActivateRollbackReq.xml")); rollbackData.put(RbType, "sdncCreateRollbackReq", FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncCreateRollbackReq.xml")); 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 167c2fa44b..0ffe16380f 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml +++ b/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml @@ -1,5 +1,5 @@ aai: - auth: 26AFB797A6A57960D5D718491925C50F77CDC22AC394B3DBA09950D8FD1C0764 + auth: 5A1272FE739BECA4D4374A86B25C021DFE6745E3BB7BE6836BF64A6059B8220E586C21FD7567AF41DB42571EB7 endpoint: http://localhost:${wiremock.server.port} appc: client: @@ -22,7 +22,7 @@ mso: completemsoprocess: endpoint: http://localhost:${wiremock.server.port}/CompleteMsoProcess db: - auth: 757A94191D685FD2092AC1490730A4FC + auth: 5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C endpoint: http://localhost:${wiremock.server.port}/dbadapters/RequestsDbAdapter spring: endpoint: http://localhost:${wiremock.server.port} @@ -34,7 +34,7 @@ mso: db: endpoint: http://localhost:${wiremock.server.port}/dbadapters/RequestsDbAdapter po: - auth: 757A94191D685FD2092AC1490730A4FC + auth: 5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C password: 3141634BF7E070AA289CF2892C986C0B sdnc: endpoint: http://localhost:${wiremock.server.port}/SDNCAdapter @@ -178,7 +178,7 @@ sniro: headers.latestVersion: 2 spring: datasource: - url: jdbc:mariadb://localhost:3307/camundabpmn + jdbc-url: jdbc:mariadb://localhost:3307/camundabpmn username: root password: password driver-class-name: org.mariadb.jdbc.Driver @@ -205,4 +205,4 @@ camunda: bpm: metrics: enabled: false - db-reporter-activate: false
\ No newline at end of file + db-reporter-activate: false |