aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisher.java9
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java30
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisherTest.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml21
5 files changed, 58 insertions, 10 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
index 025b533dc0..750f25532c 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -154,7 +156,7 @@ public class ResourceRequestBuilder {
}
}
- if (resourceInputStr != null || !resourceInputStr.equals("")) {
+ if (resourceInputStr != null && !resourceInputStr.isEmpty()) {
return getResourceInput(resourceInputStr, serviceInputs);
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisher.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisher.java
index 382852886e..17b99e2741 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisher.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisher.java
@@ -38,22 +38,21 @@ public class GlobalDmaapPublisher extends DmaapPublisher {
}
@Override
- public String getUserName() {
+ public String getAuth() {
- return UrnPropertiesReader.getVariable("mso.global.dmaap.username");
+ return UrnPropertiesReader.getVariable("mso.global.dmaap.auth");
}
@Override
- public String getPassword() {
+ public String getKey() {
- return UrnPropertiesReader.getVariable("mso.global.dmaap.password");
+ return UrnPropertiesReader.getVariable("mso.msoKey");
}
@Override
public String getTopic() {
-
return UrnPropertiesReader.getVariable("mso.global.dmaap.publisher.topic");
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java
index e5e13268b2..ddca319708 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java
@@ -405,4 +405,32 @@ public class ResourceRequestBuilderTest extends BaseTest {
assertEquals(resourceSequence.get(0), "res1");
assertEquals(resourceSequence.get(1), "res2");
}
-} \ No newline at end of file
+
+ @Test
+ public void getResourceInputWithEmptyServiceResourcesTest() throws Exception {
+
+ stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
+ .willReturn(ok("{ \"serviceResources\" : {\n" +
+ "\t\"modelInfo\" : {\n" +
+ "\t\t\"modelName\" : \"demoVFWCL\",\n" +
+ "\t\t\"modelUuid\" : \"c3954379-4efe-431c-8258-f84905b158e5\",\n" +
+ "\t\t\"modelInvariantUuid\" : \"0cbff61e-3b0a-4eed-97ce-b1b4faa03493\",\n" +
+ "\t\t\"modelVersion\" : \"1.0\"\n" +
+ "\t},\n" +
+ "\t\"serviceType\" : \"\",\n" +
+ "\t\"serviceRole\" : \"\",\n" +
+ "\t\"environmentContext\" : null,\n" +
+ "\t\"workloadContext\" : \"Production\",\n" +
+ "\t\"serviceVnfs\": [], \n" +
+ "\t\"serviceNetworks\": [],\n" +
+ "\t\"serviceAllottedResources\": []\n" +
+ "\t}}")));
+
+ HashMap serviceInput = new HashMap();
+ serviceInput.put("key1", "value");
+ Map<String, Object> stringObjectMap = ResourceRequestBuilder.buildResouceRequest("c3954379-4efe-431c-8258-f84905b158e5",
+ "e776449e-2b10-45c5-9217-2775c88ca1a0", serviceInput);
+ assertEquals(0, stringObjectMap.size());
+ }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisherTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisherTest.java
index 4d7c85efdb..fc69f812be 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisherTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/GlobalDmaapPublisherTest.java
@@ -35,8 +35,8 @@ public class GlobalDmaapPublisherTest extends BaseTest{
@Test
public void testGetters() {
- assertEquals("dmaapUsername", globalDmaapPublisher.getUserName());
- assertEquals("ZG1hYXBQYXNzd29yZA==", globalDmaapPublisher.getPassword());
+ assertEquals("81B7E3533B91A6706830611FB9A8ECE529BBCCE754B1F1520FA7C8698B42F97235BEFA993A387E664D6352C63A6185D68DA7F0B1D360637CBA102CB166E3E62C11EB1F75386D3506BCECE51E54", globalDmaapPublisher.getAuth());
+ assertEquals("07a7159d3bf51a0e53be7a8f89699be7", globalDmaapPublisher.getKey());
assertEquals("com.att.mso.asyncStatusUpdate", globalDmaapPublisher.getTopic());
assertEquals("http://localhost:" + wireMockPort, globalDmaapPublisher.getHost().get());
}
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml b/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml
index 945972c9e2..afdb800ffe 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml
+++ b/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml
@@ -146,6 +146,7 @@ mso:
host: http://localhost:${wiremock.server.port}
publisher:
topic: com.att.mso.asyncStatusUpdate
+ auth: 81B7E3533B91A6706830611FB9A8ECE529BBCCE754B1F1520FA7C8698B42F97235BEFA993A387E664D6352C63A6185D68DA7F0B1D360637CBA102CB166E3E62C11EB1F75386D3506BCECE51E54
oof:
auth: test
timeout: PT10S
@@ -163,6 +164,16 @@ sdnc:
auth: Basic YWRtaW46YWRtaW4=
host: http://localhost:8446
path: /restconf/operations/GENERIC-RESOURCE-API
+sdno:
+ health-check:
+ dmaap:
+ password: alRyMzJ3NUNeakxl
+ publisher:
+ topic: com.att.sdno.test-health-diagnostic-v02
+ host: https://olsd004.wnsnet.attws.com:3905
+ subscriber:
+ topic: com.att.sdno.test-health-diagnostic-v02
+ auth: 81B7E3533B91A6706830611FB9A8ECE529BBCCE754B1F1520FA7C8698B42F97235BEFA993A387E664D6352C63A6185D68DA7F0B1D360637CBA102CB166E3E62C11EB1F75386D3506BCECE51E54
sniro:
conductor:
enabled: true
@@ -178,7 +189,15 @@ sniro:
headers.patchVersion: 1
headers.minorVersion: 1
headers.latestVersion: 2
-
+ruby:
+ create-ticket-request:
+ dmaap:
+ username: m04768@mso.ecomp.att.com
+ password: alRyMzJ3NUNeakxl
+ publisher:
+ topic: com.att.pdas.exp.msoCMFallout-v1
+ host: https://olsd004.wnsnet.attws.com:3905
+ auth: 81B7E3533B91A6706830611FB9A8ECE529BBCCE754B1F1520FA7C8698B42F97235BEFA993A387E664D6352C63A6185D68DA7F0B1D360637CBA102CB166E3E62C11EB1F75386D3506BCECE51E54
spring:
datasource:
jdbc-url: jdbc:mariadb://localhost:3307/camundabpmn