From d064d9be33bc3a210397adc147967ce77eb63c4f Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Sat, 27 Apr 2019 07:43:35 -0400 Subject: Correct Catalog DB beans Correct Catalog DB beans Change-Id: Ie9bb4aef606da8c87e5960c95b564fb2fc299869 Issue-ID: SO-1828 Signed-off-by: Kuleshov, Elena --- .../WorkflowSpecificationsHandler.java | 4 + .../WorkflowSpecificationsHandlerTest.java | 60 ++ .../catalogdb/ActivitySpecSequence1_Response.json | 20 + .../catalogdb/ActivitySpecSequence2_Response.json | 20 + .../catalogdb/ActivitySpecSequence3_Response.json | 20 + .../ActivitySpecUserParameters1_Response.json | 103 +++ .../ActivitySpecUserParameters2_Response.json | 103 +++ .../ActivitySpecUserParameters3_Response.json | 103 +++ .../catalogdb/UserParameters1_Response.json | 13 + .../catalogdb/UserParameters2_Response.json | 13 + .../catalogdb/UserParameters3_Response.json | 13 + .../catalogdb/UserParameters4_Response.json | 13 + .../catalogdb/UserParameters5_Response.json | 13 + .../catalogdb/UserParameters6_Response.json | 13 + .../WorkflowActivitySpecSequence_Response.json | 480 ++--------- .../WorkflowSpecificationsQuery_Response.json | 937 +++++++++++---------- 16 files changed, 1034 insertions(+), 894 deletions(-) create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence1_Response.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence2_Response.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence3_Response.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters1_Response.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters2_Response.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters3_Response.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters1_Response.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters2_Response.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters3_Response.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters4_Response.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters5_Response.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters6_Response.json (limited to 'mso-api-handlers') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java index c480bdfbd3..890b54758e 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java @@ -50,6 +50,8 @@ import org.onap.so.db.catalog.beans.WorkflowActivitySpecSequence; import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.logger.ErrorCode; import org.onap.so.logger.MessageEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.fasterxml.jackson.core.JsonProcessingException; @@ -69,6 +71,7 @@ public class WorkflowSpecificationsHandler { @Autowired private CatalogDbClient catalogDbClient; + private static Logger logger = LoggerFactory.getLogger(WorkflowSpecificationsHandler.class); private static final String ARTIFACT_TYPE_WORKFLOW = "workflow"; @Path("/{version:[vV]1}/workflows") @@ -153,6 +156,7 @@ public class WorkflowSpecificationsHandler { if (activitySpec != null) { ActivitySequence activitySequence = new ActivitySequence(); activitySequence.setName(activitySpec.getName()); + logger.debug("Adding activity: " + activitySpec.getName()); activitySequence.setDescription(activitySpec.getDescription()); activitySequences.add(activitySequence); } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java index 48abeacbc5..915018f7e4 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java @@ -87,6 +87,66 @@ public class WorkflowSpecificationsHandlerTest extends BaseTest { .withBody(getWiremockResponseForCatalogdb("WorkflowActivitySpecSequence_Response.json")) .withStatus(org.apache.http.HttpStatus.SC_OK))); + wireMockServer.stubFor(get(urlMatching("/workflowActivitySpecSequence/1/activitySpec")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("ActivitySpecSequence1_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + wireMockServer.stubFor(get(urlMatching("/workflowActivitySpecSequence/2/activitySpec")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("ActivitySpecSequence2_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + wireMockServer.stubFor(get(urlMatching("/workflowActivitySpecSequence/3/activitySpec")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("ActivitySpecSequence3_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + wireMockServer.stubFor(get(urlMatching("/activitySpec/1/activitySpecUserParameters")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("ActivitySpecUserParameters1_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + wireMockServer.stubFor(get(urlMatching("/activitySpec/2/activitySpecUserParameters")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("ActivitySpecUserParameters2_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + wireMockServer.stubFor(get(urlMatching("/activitySpec/3/activitySpecUserParameters")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("ActivitySpecUserParameters3_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + wireMockServer.stubFor(get(urlMatching("/activitySpecUserParameters/1/userParameters")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("UserParameters1_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + wireMockServer.stubFor(get(urlMatching("/activitySpecUserParameters/2/userParameters")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("UserParameters2_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + wireMockServer.stubFor(get(urlMatching("/activitySpecUserParameters/3/userParameters")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("UserParameters3_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + wireMockServer.stubFor(get(urlMatching("/activitySpecUserParameters/4/userParameters")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("UserParameters4_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + wireMockServer.stubFor(get(urlMatching("/activitySpecUserParameters/5/userParameters")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("UserParameters5_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + wireMockServer.stubFor(get(urlMatching("/activitySpecUserParameters/6/userParameters")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("UserParameters6_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort(basePath)) .queryParam("vnfModelVersionId", "b5fa707a-f55a-11e7-a796-005056856d52"); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence1_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence1_Response.json new file mode 100644 index 0000000000..37e32631fb --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence1_Response.json @@ -0,0 +1,20 @@ +{ + "name": "VNFQuiesceTrafficActivity", + "description": "Activity to QuiesceTraffic on VNF", + "version": null, + "created": null, + "activitySpecActivitySpecCategories": null, + "activitySpecActivitySpecParameters": null, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpec/1" + }, + "activitySpec": { + "href": "http://localhost:8090/activitySpec/1" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpec/1/activitySpecUserParameters" + } + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence2_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence2_Response.json new file mode 100644 index 0000000000..ee2a02ba33 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence2_Response.json @@ -0,0 +1,20 @@ +{ + "name": "VNFHealthCheckActivity", + "description": "Activity to HealthCheck VNF", + "version": null, + "created": null, + "activitySpecActivitySpecCategories": null, + "activitySpecActivitySpecParameters": null, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpec/2" + }, + "activitySpec": { + "href": "http://localhost:8090/activitySpec/2" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpec/2/activitySpecUserParameters" + } + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence3_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence3_Response.json new file mode 100644 index 0000000000..69390eea6b --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecSequence3_Response.json @@ -0,0 +1,20 @@ +{ + "name": "FlowCompleteActivity", + "description": "Activity to Complete the BPMN Flow", + "version": null, + "created": null, + "activitySpecActivitySpecCategories": null, + "activitySpecActivitySpecParameters": null, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpec/3" + }, + "activitySpec": { + "href": "http://localhost:8090/activitySpec/3" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpec/3/activitySpecUserParameters" + } + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters1_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters1_Response.json new file mode 100644 index 0000000000..e88691b4d8 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters1_Response.json @@ -0,0 +1,103 @@ +{ + "_embedded": { + "activitySpecUserParameters": [ + { + "activitySpecId": 1, + "userParametersId": 1, + "activitySpec": null, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/1" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/1" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/1/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 2, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/2" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/2" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/2/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 3, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/3" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/3" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/3/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 4, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/4" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/4" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/4/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 5, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/5" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/5" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/5/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 6, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/6" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/6" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/6/userParameters" + } + } + } + ] + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters2_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters2_Response.json new file mode 100644 index 0000000000..e88691b4d8 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters2_Response.json @@ -0,0 +1,103 @@ +{ + "_embedded": { + "activitySpecUserParameters": [ + { + "activitySpecId": 1, + "userParametersId": 1, + "activitySpec": null, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/1" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/1" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/1/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 2, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/2" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/2" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/2/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 3, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/3" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/3" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/3/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 4, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/4" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/4" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/4/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 5, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/5" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/5" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/5/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 6, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/6" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/6" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/6/userParameters" + } + } + } + ] + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters3_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters3_Response.json new file mode 100644 index 0000000000..e88691b4d8 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/ActivitySpecUserParameters3_Response.json @@ -0,0 +1,103 @@ +{ + "_embedded": { + "activitySpecUserParameters": [ + { + "activitySpecId": 1, + "userParametersId": 1, + "activitySpec": null, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/1" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/1" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/1/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 2, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/2" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/2" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/2/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 3, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/3" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/3" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/3/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 4, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/4" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/4" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/4/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 5, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/5" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/5" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/5/userParameters" + } + } + }, + { + "activitySpecId": 1, + "userParametersId": 6, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/activitySpecUserParameters/6" + }, + "activitySpecUserParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/6" + }, + "userParameters": { + "href": "http://localhost:8090/activitySpecUserParameters/6/userParameters" + } + } + } + ] + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters1_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters1_Response.json new file mode 100644 index 0000000000..017add4cd5 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters1_Response.json @@ -0,0 +1,13 @@ +{ + "name": "operations_timeout", + "payloadLocation": "userParams", + "label": "Operations Timeout", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters2_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters2_Response.json new file mode 100644 index 0000000000..655d659c16 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters2_Response.json @@ -0,0 +1,13 @@ +{ + "name": "existing_software_version", + "payloadLocation": "userParams", + "label": "Existing Software Version", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters3_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters3_Response.json new file mode 100644 index 0000000000..13e02e7dd6 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters3_Response.json @@ -0,0 +1,13 @@ +{ + "name": "cloudOwner", + "payloadLocation": "cloudConfiguration", + "label": "Cloud Owner", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 7, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters4_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters4_Response.json new file mode 100644 index 0000000000..e30ec0da88 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters4_Response.json @@ -0,0 +1,13 @@ +{ + "name": "tenantId", + "payloadLocation": "cloudConfiguration", + "label": "Tenant/Project ID", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 36, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters5_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters5_Response.json new file mode 100644 index 0000000000..98b18522da --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters5_Response.json @@ -0,0 +1,13 @@ +{ + "name": "new_software_version", + "payloadLocation": "userParams", + "label": "New Software Version", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters6_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters6_Response.json new file mode 100644 index 0000000000..4d8d03b6a7 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/UserParameters6_Response.json @@ -0,0 +1,13 @@ +{ + "name": "lcpCloudRegionId", + "payloadLocation": "cloudConfiguration", + "label": "Cloud Region ID", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 7, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowActivitySpecSequence_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowActivitySpecSequence_Response.json index 3192865b52..3df17380d6 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowActivitySpecSequence_Response.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowActivitySpecSequence_Response.json @@ -1,432 +1,54 @@ { "_embedded": { - - "workflowActivitySpecSequence": [ - { - "activitySpecId": null, - "workflowId": null, - "activitySpec": { - "name": "VNFQuiesceTrafficActivity", - "description": "Activity to QuiesceTraffic on VNF", - "version": null, - "created": null, - "workflowActivitySpecSequence": null, - "activitySpecActivitySpecCategories": null, - "activitySpecUserParameters": [ - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "operations_timeout", - "payloadLocation": "userParams", - "label": "Operations Timeout", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "existing_software_version", - "payloadLocation": "userParams", - "label": "Existing Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "cloudOwner", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Owner", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "tenantId", - "payloadLocation": "cloudConfiguration", - "label": "Tenant/Project ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 36, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "new_software_version", - "payloadLocation": "userParams", - "label": "New Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "lcpCloudRegionId", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Region ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - } - ], - "activitySpecActivitySpecParameters": null, - "id": null - }, - "workflow": null, - "id": null, - "_links": { - "self": { - "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" - }, - "workflowActivitySpecSequence": { - "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" - } - - } - - }, - { - "activitySpecId": null, - "workflowId": null, - "activitySpec": { - "name": "VNFHealthCheckActivity", - "description": "Activity to HealthCheck VNF", - "version": null, - "created": null, - "workflowActivitySpecSequence": null, - "activitySpecActivitySpecCategories": null, - "activitySpecUserParameters": [ - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "operations_timeout", - "payloadLocation": "userParams", - "label": "Operations Timeout", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "existing_software_version", - "payloadLocation": "userParams", - "label": "Existing Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "cloudOwner", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Owner", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "tenantId", - "payloadLocation": "cloudConfiguration", - "label": "Tenant/Project ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 36, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "new_software_version", - "payloadLocation": "userParams", - "label": "New Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "lcpCloudRegionId", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Region ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - } - ], - "activitySpecActivitySpecParameters": null, - "id": null - }, - "workflow": null, - "id": null, - "_links": { - "self": { - "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" - }, - "workflowActivitySpecSequence": { - "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" - } - - } - }, - { - "activitySpecId": null, - "workflowId": null, - "activitySpec": { - "name": "FlowCompleteActivity", - "description": "Activity to Complete the BPMN Flow", - "version": null, - "created": null, - "workflowActivitySpecSequence": null, - "activitySpecActivitySpecCategories": null, - "activitySpecUserParameters": [ - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "operations_timeout", - "payloadLocation": "userParams", - "label": "Operations Timeout", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "existing_software_version", - "payloadLocation": "userParams", - "label": "Existing Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "cloudOwner", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Owner", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "tenantId", - "payloadLocation": "cloudConfiguration", - "label": "Tenant/Project ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 36, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "new_software_version", - "payloadLocation": "userParams", - "label": "New Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "lcpCloudRegionId", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Region ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - } - ], - "activitySpecActivitySpecParameters": null, - "id": null - }, - "workflow": null, - "id": null, - "_links": { - "self": { - "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" - }, - "workflowActivitySpecSequence": { - "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" - } - - } - } - ] - -} + "workflowActivitySpecSequence": [ + { + "activitySpecId": 1, + "workflowId": 1, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/workflowActivitySpecSequence//1/workflowActivitySpecSequence" + }, + "workflowActivitySpecSequence": { + "href": "http://localhost:8090/workflowActivitySpecSequence/1/workflowActivitySpecSequence" + }, + "activitySpec": { + "href": "http://localhost:8090/workflowActivitySpecSequence/1/activitySpec" + } + } + }, + { + "activitySpecId": 2, + "workflowId": 1, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/workflowActivitySpecSequence/2/workflowActivitySpecSequence" + }, + "workflowActivitySpecSequence": { + "href": "http://localhost:8090/workflowActivitySpecSequence/2/workflowActivitySpecSequence" + }, + "activitySpec": { + "href": "http://localhost:8090/workflowActivitySpecSequence/2/activitySpec" + } + } + }, + { + "activitySpecId": 3, + "workflowId": 1, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/workflowActivitySpecSequence/3" + }, + "workflowActivitySpecSequence": { + "href": "http://localhost:8090/workflowActivitySpecSequence/3/workflowActivitySpecSequence" + }, + "activitySpec": { + "href": "http://localhost:8090/workflowActivitySpecSequence/3/activitySpec" + } + } + } + ] + } } \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecificationsQuery_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecificationsQuery_Response.json index c12365649e..cbbf0b69f6 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecificationsQuery_Response.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecificationsQuery_Response.json @@ -1,468 +1,475 @@ { "_embedded": { - "workflows" :[ - { - "artifactUUID": "ab6478e4-ea33-3346-ac12-ab121484a333", - "artifactName": "inPlaceSoftwareUpdate-1_0.bpmn", - "name": "inPlaceSoftwareUpdate", - "operationName": "inPlaceSoftwareUpdate", - "version": 1, - "description": "xyz xyz", - "body": null, - "resourceTarget": "vnf", - "source": "sdc", - "timeoutMinutes": null, - "artifactChecksum": null, - "created": null, - "vnfResourceWorkflow": null, - "workflowActivitySpecSequence": [ - { - "activitySpecId": null, - "workflowId": null, - "activitySpec": { - "name": "VNFQuiesceTrafficActivity", - "description": "Activity to QuiesceTraffic on VNF", - "version": null, - "created": null, - "workflowActivitySpecSequence": null, - "activitySpecActivitySpecCategories": null, - "activitySpecUserParameters": [ - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "operations_timeout", - "payloadLocation": "userParams", - "label": "Operations Timeout", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "existing_software_version", - "payloadLocation": "userParams", - "label": "Existing Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "cloudOwner", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Owner", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "tenantId", - "payloadLocation": "cloudConfiguration", - "label": "Tenant/Project ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 36, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "new_software_version", - "payloadLocation": "userParams", - "label": "New Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "lcpCloudRegionId", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Region ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - } - ], - "activitySpecActivitySpecParameters": null, - "id": null - }, - "workflow": null, - "id": null, - "_links": { - "self": { - "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID[?]vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" - }, - "workflowActivitySpecSequence": { - "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" - } - - } - - }, - { - "activitySpecId": null, - "workflowId": null, - "activitySpec": { - "name": "VNFHealthCheckActivity", - "description": "Activity to HealthCheck VNF", - "version": null, - "created": null, - "workflowActivitySpecSequence": null, - "activitySpecActivitySpecCategories": null, - "activitySpecUserParameters": [ - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "operations_timeout", - "payloadLocation": "userParams", - "label": "Operations Timeout", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "existing_software_version", - "payloadLocation": "userParams", - "label": "Existing Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "cloudOwner", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Owner", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "tenantId", - "payloadLocation": "cloudConfiguration", - "label": "Tenant/Project ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 36, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "new_software_version", - "payloadLocation": "userParams", - "label": "New Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "lcpCloudRegionId", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Region ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - } - ], - "activitySpecActivitySpecParameters": null, - "id": null - }, - "workflow": null, - "id": null, - "_links": { - "self": { - "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" - }, - "workflowActivitySpecSequence": { - "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" - } - - } - }, - { - "activitySpecId": null, - "workflowId": null, - "activitySpec": { - "name": "FlowCompleteActivity", - "description": "Activity to Complete the BPMN Flow", - "version": null, - "created": null, - "workflowActivitySpecSequence": null, - "activitySpecActivitySpecCategories": null, - "activitySpecUserParameters": [ - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "operations_timeout", - "payloadLocation": "userParams", - "label": "Operations Timeout", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "existing_software_version", - "payloadLocation": "userParams", - "label": "Existing Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "cloudOwner", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Owner", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "tenantId", - "payloadLocation": "cloudConfiguration", - "label": "Tenant/Project ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 36, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "new_software_version", - "payloadLocation": "userParams", - "label": "New Software Version", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 50, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - }, - { - "activitySpecId": null, - "userParametersId": null, - "activitySpec": null, - "userParameters": { - "name": "lcpCloudRegionId", - "payloadLocation": "cloudConfiguration", - "label": "Cloud Region ID", - "type": "text", - "description": null, - "isRequried": true, - "maxLength": 7, - "allowableChars": "someRegEx", - "created": null, - "activitySpecUserParameters": null, - "id": null - }, - "id": null - } - ], - "activitySpecActivitySpecParameters": null, - "id": null - }, - "workflow": null, - "id": null, - "_links": { - "self": { - "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" - }, - "workflowActivitySpecSequence": { - "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" - } - - } - } - ], - "id": null, - - "_links": { - "self": { - "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" - }, - "workflowActivitySpecSequence": { - "href": "http://localhost:8090/workflow/1/workflowActivitySpecSequence" - } - - } - - } -] -}, -"_links": { - "self": { - "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" - }, - "workflowActivitySpecSequence": { - "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" - } - - } + "workflows": [ + { + "artifactUUID": "ab6478e4-ea33-3346-ac12-ab121484a333", + "artifactName": "inPlaceSoftwareUpdate-1_0.bpmn", + "name": "inPlaceSoftwareUpdate", + "operationName": "inPlaceSoftwareUpdate", + "version": 1, + "description": "xyz xyz", + "body": null, + "resourceTarget": "vnf", + "source": "sdc", + "timeoutMinutes": null, + "artifactChecksum": null, + "created": null, + "vnfResourceWorkflow": null, + "workflowActivitySpecSequence": [ + { + "activitySpecId": null, + "workflowId": null, + "activitySpec": { + "name": "VNFQuiesceTrafficActivity", + "description": "Activity to QuiesceTraffic on VNF", + "version": null, + "created": null, + "workflowActivitySpecSequence": null, + "activitySpecActivitySpecCategories": null, + "activitySpecUserParameters": [ + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "operations_timeout", + "payloadLocation": "userParams", + "label": "Operations Timeout", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "existing_software_version", + "payloadLocation": "userParams", + "label": "Existing Software Version", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "cloudOwner", + "payloadLocation": "cloudConfiguration", + "label": "Cloud Owner", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 7, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "tenantId", + "payloadLocation": "cloudConfiguration", + "label": "Tenant/Project ID", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 36, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "new_software_version", + "payloadLocation": "userParams", + "label": "New Software Version", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "lcpCloudRegionId", + "payloadLocation": "cloudConfiguration", + "label": "Cloud Region ID", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 7, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + } + ], + "activitySpecActivitySpecParameters": null, + "id": null + }, + "workflow": null, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID[?]vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" + }, + "workflowActivitySpecSequence": { + "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" + }, + "activitySpec": { + "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/activitySpec" + } + } + }, + { + "activitySpecId": null, + "workflowId": null, + "activitySpec": { + "name": "VNFHealthCheckActivity", + "description": "Activity to HealthCheck VNF", + "version": null, + "created": null, + "workflowActivitySpecSequence": null, + "activitySpecActivitySpecCategories": null, + "activitySpecUserParameters": [ + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "operations_timeout", + "payloadLocation": "userParams", + "label": "Operations Timeout", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "existing_software_version", + "payloadLocation": "userParams", + "label": "Existing Software Version", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "cloudOwner", + "payloadLocation": "cloudConfiguration", + "label": "Cloud Owner", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 7, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "tenantId", + "payloadLocation": "cloudConfiguration", + "label": "Tenant/Project ID", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 36, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "new_software_version", + "payloadLocation": "userParams", + "label": "New Software Version", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "lcpCloudRegionId", + "payloadLocation": "cloudConfiguration", + "label": "Cloud Region ID", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 7, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + } + ], + "activitySpecActivitySpecParameters": null, + "id": null + }, + "workflow": null, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" + }, + "workflowActivitySpecSequence": { + "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" + }, + "activitySpec": { + "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/activitySpec" + } + } + }, + { + "activitySpecId": null, + "workflowId": null, + "activitySpec": { + "name": "FlowCompleteActivity", + "description": "Activity to Complete the BPMN Flow", + "version": null, + "created": null, + "workflowActivitySpecSequence": null, + "activitySpecActivitySpecCategories": null, + "activitySpecUserParameters": [ + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "operations_timeout", + "payloadLocation": "userParams", + "label": "Operations Timeout", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "existing_software_version", + "payloadLocation": "userParams", + "label": "Existing Software Version", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "cloudOwner", + "payloadLocation": "cloudConfiguration", + "label": "Cloud Owner", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 7, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "tenantId", + "payloadLocation": "cloudConfiguration", + "label": "Tenant/Project ID", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 36, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "new_software_version", + "payloadLocation": "userParams", + "label": "New Software Version", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 50, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + }, + { + "activitySpecId": null, + "userParametersId": null, + "activitySpec": null, + "userParameters": { + "name": "lcpCloudRegionId", + "payloadLocation": "cloudConfiguration", + "label": "Cloud Region ID", + "type": "text", + "description": null, + "isRequried": true, + "maxLength": 7, + "allowableChars": "someRegEx", + "created": null, + "activitySpecUserParameters": null, + "id": null + }, + "id": null + } + ], + "activitySpecActivitySpecParameters": null, + "id": null + }, + "workflow": null, + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" + }, + "workflowActivitySpecSequence": { + "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" + }, + "activitySpec": { + "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/activitySpec" + } + } + } + ], + "id": null, + "_links": { + "self": { + "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" + }, + "workflowActivitySpecSequence": { + "href": "http://localhost:8090/workflow/1/workflowActivitySpecSequence" + }, + "activitySpec": { + "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/activitySpec" + } + } + } + ] + }, + "_links": { + "self": { + "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" + }, + "workflowActivitySpecSequence": { + "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" + }, + "activitySpec": { + "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/activitySpec" + } + } } \ No newline at end of file -- cgit 1.2.3-korg From 406908c43e35f4ff3f8334d00452048c71d93955 Mon Sep 17 00:00:00 2001 From: "Bonkur, Venkat (vb8416)" Date: Mon, 13 May 2019 03:00:16 -0400 Subject: Add SO native workflows to result list Added native workflows to result list Issue-ID: SO-1852 Signed-off-by: Bonkur, Venkat (vb8416) Change-Id: Ifeb2adf4ea78b191bcf46a1e7367bc0939d53b83 --- .../WorkflowSpecificationsHandler.java | 7 ++++++ .../WorkflowSpecificationsHandlerTest.java | 11 ++++++++ .../__files/catalogdb/WorkflowSpecifications.json | 16 ++++++++++++ .../WorkflowSpecificationsQuery_Response.json | 29 ++++++++++++++++++++++ 4 files changed, 63 insertions(+) (limited to 'mso-api-handlers') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java index 890b54758e..e8171ac834 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java @@ -73,6 +73,7 @@ public class WorkflowSpecificationsHandler { private static Logger logger = LoggerFactory.getLogger(WorkflowSpecificationsHandler.class); private static final String ARTIFACT_TYPE_WORKFLOW = "workflow"; + private static final String NATIVE_WORKFLOW = "native"; @Path("/{version:[vV]1}/workflows") @GET @@ -88,6 +89,12 @@ public class WorkflowSpecificationsHandler { mapper1.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); List workflows = catalogDbClient.findWorkflowByModelUUID(vnfModelVersionId); + + List nativeWorkflows = catalogDbClient.findWorkflowBySource(NATIVE_WORKFLOW); + if (nativeWorkflows != null && nativeWorkflows.size() != 0) { + workflows.addAll(nativeWorkflows); + } + WorkflowSpecifications workflowSpecifications = mapWorkflowsToWorkflowSpecifications(workflows); String jsonResponse = null; diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java index 915018f7e4..0beab1bd13 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java @@ -297,6 +297,17 @@ public class WorkflowSpecificationsHandlerTest extends BaseTest { workflow.setWorkflowActivitySpecSequence(workflowActivitySpecSequences); workflows.add(workflow); + Workflow workflowNative = new Workflow(); + workflowNative.setArtifactUUID("da6478e4-ea33-3346-ac12-ab121284a333"); + workflowNative.setArtifactName("VnfInPlaceUpdate.bpmn"); + workflowNative.setVersion(1.0); + workflowNative.setDescription("native workflow"); + workflowNative.setName("VnfInPlaceUpdate"); + workflowNative.setOperationName("inPlaceSoftwareUpdate"); + workflowNative.setSource("native"); + workflowNative.setResourceTarget("vnf"); + workflows.add(workflowNative); + WorkflowSpecifications workflowSpecifications = workflowSpecificationsHandler.mapWorkflowsToWorkflowSpecifications(workflows); ObjectMapper mapper = new ObjectMapper(); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json index 5556c602be..545fbbe26c 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json @@ -108,6 +108,22 @@ } ] } + }, + { + "workflowSpecification": { + + "artifactInfo": { + "artifactType": "workflow", + "artifactUuid": "da6478e4-ea33-3346-ac12-ab121284a333", + "artifactName": "VnfInPlaceUpdate.bpmn", + "artifactVersion": "1.0", + "artifactDescription": "native workflow", + "workflowName": "VnfInPlaceUpdate", + "operationName": "inPlaceSoftwareUpdate", + "workflowSource": "native", + "workflowResourceTarget": "vnf" + } + } } ] } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecificationsQuery_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecificationsQuery_Response.json index cbbf0b69f6..8919dbbf2c 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecificationsQuery_Response.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecificationsQuery_Response.json @@ -458,6 +458,35 @@ "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/activitySpec" } } + }, + { + "artifactUUID": "da6478e4-ea33-3346-ac12-ab121284a333", + "artifactName": "VnfInPlaceUpdate.bpmn", + "name": "VnfInPlaceUpdate", + "operationName": "inPlaceSoftwareUpdate", + "version": 1, + "description": "native workflow", + "body": null, + "resourceTarget": "vnf", + "source": "native", + "timeoutMinutes": null, + "artifactChecksum": null, + "created": null, + "vnfResourceWorkflow": null, + "workflowActivitySpecSequence": [], + "id": null, + "workflow": null, + "_links": { + "self": { + "href": "http://localhost:8090/workflow/search/findWorkflowByModelUUID?vnfResourceModelUUID=b5fa707a-f55a-11e7-a796-005056856d52" + }, + "workflowActivitySpecSequence": { + "href": "http://localhost:8090/workflow/b5fa707a-f55a-11e7-a796-005056856d52/workflowActivitySpecSequence" + }, + "activitySpec": { + "href": "http://localhost:8090/workflows/b5fa707a-f55a-11e7-a796-005056856d52/activitySpec" + } + } } ] }, -- cgit 1.2.3-korg From a385c0cc6a0ed25cc63fab1368fc686d79f06bca Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Thu, 9 May 2019 12:27:30 -0400 Subject: Use workflow's name for invocation Use workflow's name for invocation Change-Id: Ie527788f029bdccc91f7f406df0a478e55375c01 Issue-ID: SO-1876 Signed-off-by: Kuleshov, Elena --- .../java/org/onap/so/db/catalog/client/CatalogDbClientTest.java | 6 +++--- .../src/test/resources/db/migration/afterMigrate.sql | 2 +- asdc-controller/src/test/resources/data.sql | 2 +- .../main/java/org/onap/so/apihandlerinfra/InstanceManagement.java | 2 +- .../src/test/resources/__files/catalogdb/workflow_Response.json | 3 ++- .../onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java | 6 +++--- mso-catalog-db/src/test/resources/data.sql | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) (limited to 'mso-api-handlers') diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java index 9265e5aa54..d8d9ee191a 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java @@ -649,7 +649,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { @Test public void getWorkflowByArtifactUUID_validUuid_expectedOutput() { Workflow workflow = client.findWorkflowByArtifactUUID("5b0c4322-643d-4c9f-b184-4516049e99b1"); - assertEquals("artifactName", "testingWorkflow", workflow.getArtifactName()); + assertEquals("artifactName", "testingWorkflow.bpmn", workflow.getArtifactName()); } @Test @@ -664,7 +664,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { assertTrue(workflows != null); assertTrue(workflows.size() != 0); - assertEquals("testingWorkflow", workflows.get(0).getArtifactName()); + assertEquals("testingWorkflow.bpmn", workflows.get(0).getArtifactName()); } @Test @@ -679,7 +679,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { assertTrue(workflows != null); assertTrue(workflows.size() != 0); - assertEquals("testingWorkflow", workflows.get(0).getArtifactName()); + assertEquals("testingWorkflow.bpmn", workflows.get(0).getArtifactName()); } @Test diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql index 0229dd0d85..1ba1597c73 100644 --- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql +++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql @@ -225,7 +225,7 @@ insert into pnf_resource_customization_to_service(service_model_uuid, resource_m ('5df8b6de-2083-11e7-93ae-92361f002676', '68dc9a92-214c-11e7-93ae-92361f002680'); insert into workflow(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values -('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc'); +('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc'); insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values ('ff2ae348-214a-11e7-93ae-92361f002671', '1'); diff --git a/asdc-controller/src/test/resources/data.sql b/asdc-controller/src/test/resources/data.sql index 47e6c4c982..c9179fe65f 100644 --- a/asdc-controller/src/test/resources/data.sql +++ b/asdc-controller/src/test/resources/data.sql @@ -26,7 +26,7 @@ insert into vnf_resource(orchestration_mode, description, creation_timestamp, mo ('HEAT', '1607 vSAMP10a - inherent network', '2017-04-14 21:46:28', 'ff2ae348-214a-11e7-93ae-92361f002671', '', '', '2fff5b20-214b-11e7-93ae-92361f002671', '1.0', 'vSAMP10a', 'VF', null); insert into workflow(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values -('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc'); +('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc'); insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values ('ff2ae348-214a-11e7-93ae-92361f002671', '1'); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java index c491444f39..dd6050bf60 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java @@ -255,7 +255,7 @@ public class InstanceManagement { if (workflow == null) { return null; } else { - String workflowName = workflow.getArtifactName(); + String workflowName = workflow.getName(); recipeUri = "/mso/async/services/" + workflowName; } return new RecipeLookupResult(recipeUri, 180); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json index 6e358f7e17..d6ed585537 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json @@ -1,4 +1,5 @@ { "artifactUUID": "71526781-e55c-4cb7-adb3-97e09d9c76be", - "artifactName": "testingWorkflow" + "artifactName": "testingWorkflow.bpmn", + "name": "testingWorkflow" } \ No newline at end of file diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java index 171d4b29f5..7d1b8d0d96 100644 --- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java +++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java @@ -31,7 +31,7 @@ public class WorkflowRepositoryTest extends BaseTest { public void findByArtifactUuid_ValidUuid_ExpectedOutput() throws Exception { Workflow workflow = workflowRepository.findByArtifactUUID("5b0c4322-643d-4c9f-b184-4516049e99b1"); - assertEquals("artifactName", "testingWorkflow", workflow.getArtifactName()); + assertEquals("artifactName", "testingWorkflow.bpmn", workflow.getArtifactName()); } @Test @@ -41,7 +41,7 @@ public class WorkflowRepositoryTest extends BaseTest { Assert.assertTrue(workflows != null); Assert.assertTrue(workflows.size() != 0); - Assert.assertTrue("testingWorkflow".equals(workflows.get(0).getArtifactName())); + Assert.assertTrue("testingWorkflow.bpmn".equals(workflows.get(0).getArtifactName())); } @Test @@ -51,7 +51,7 @@ public class WorkflowRepositoryTest extends BaseTest { Assert.assertTrue(workflows != null); Assert.assertTrue(workflows.size() != 0); - Assert.assertTrue("testingWorkflow".equals(workflows.get(0).getArtifactName())); + Assert.assertTrue("testingWorkflow.bpmn".equals(workflows.get(0).getArtifactName())); } } diff --git a/mso-catalog-db/src/test/resources/data.sql b/mso-catalog-db/src/test/resources/data.sql index f6d04263c0..31f59203ca 100644 --- a/mso-catalog-db/src/test/resources/data.sql +++ b/mso-catalog-db/src/test/resources/data.sql @@ -742,7 +742,7 @@ insert into pnf_resource_customization_to_service(service_model_uuid, resource_m ('5df8b6de-2083-11e7-93ae-92361f002676', '68dc9a92-214c-11e7-93ae-92361f002680'); insert into workflow(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values -('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc'); +('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc'); insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values ('ff2ae348-214a-11e7-93ae-92361f002671', '1'); -- cgit 1.2.3-korg From 52a1a5a22a9bd4e183c8c0607e2b75f6503a43c9 Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Thu, 23 May 2019 02:07:32 -0400 Subject: Return empty WorkflowInputParameters Return empty WorkflowInputParameters when none are available Issue-ID: SO-1919 Signed-off-by: Kuleshov, Elena Change-Id: I057e30bb55f6545c25060c28e1af097286f4e88b --- .../org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java | 4 ++-- .../src/test/resources/__files/catalogdb/WorkflowSpecifications.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'mso-api-handlers') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java index e8171ac834..bba8064f7c 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java @@ -175,7 +175,7 @@ public class WorkflowSpecificationsHandler { private List buildWorkflowInputParameters(Workflow workflow) { List workflowActivitySpecSequences = workflow.getWorkflowActivitySpecSequence(); if (workflowActivitySpecSequences == null || workflowActivitySpecSequences.size() == 0) { - return null; + return new ArrayList(); } Map workflowInputParameterMap = new HashMap(); for (WorkflowActivitySpecSequence workflowActivitySpecSequence : workflowActivitySpecSequences) { @@ -199,7 +199,7 @@ public class WorkflowSpecificationsHandler { } if (workflowInputParameterMap.size() == 0) { - return null; + return new ArrayList(); } List workflowInputParameterList = workflowInputParameterMap.values().stream().collect(Collectors.toList()); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json index 545fbbe26c..59bc12d92d 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json @@ -122,7 +122,8 @@ "operationName": "inPlaceSoftwareUpdate", "workflowSource": "native", "workflowResourceTarget": "vnf" - } + }, + "workflowInputParameters": [] } } ] -- cgit 1.2.3-korg From b802b088c9a46ba34ae1cdfe7c70ba8a8a51cbb5 Mon Sep 17 00:00:00 2001 From: "Bonkur, Venkat (vb8416)" Date: Mon, 3 Jun 2019 15:36:31 -0400 Subject: Add SO Turn off OpenStack heat stack audit UPDATE these files so/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml so/mso-api-handlers/mso-api-handler-infra/src/main/resources/application.yaml should have mso: infra: auditInventory: false Issue-ID: SO-1974 Signed-off-by: Bonkur, Venkat (vb8416) Change-Id: I57bb396604e9eb2787122199cdf8a2d1ce54048a --- bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml | 4 ++-- .../mso-api-handler-infra/src/main/resources/application.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mso-api-handlers') diff --git a/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml b/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml index a91cb9d88d..e364981a66 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml +++ b/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml @@ -4,7 +4,7 @@ server: max-threads: 50 mso: infra: - auditInventory: true + auditInventory: false spring: datasource: driver-class-name: org.mariadb.jdbc.Driver @@ -36,4 +36,4 @@ management: export: prometheus: enabled: true # Whether exporting of metrics to Prometheus is enabled. - step: 1m # Step size (i.e. reporting frequency) to use. \ No newline at end of file + step: 1m # Step size (i.e. reporting frequency) to use. diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/resources/application.yaml b/mso-api-handlers/mso-api-handler-infra/src/main/resources/application.yaml index e709758223..03934edf20 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/resources/application.yaml +++ b/mso-api-handlers/mso-api-handler-infra/src/main/resources/application.yaml @@ -7,7 +7,7 @@ server: mso: infra: - auditInventory: true + auditInventory: false default: versions: apiMinorVersion: 0 @@ -70,4 +70,4 @@ org: so: adapters: network: - encryptionKey: aa3871669d893c7fb8abbcda31b88b4f \ No newline at end of file + encryptionKey: aa3871669d893c7fb8abbcda31b88b4f -- cgit 1.2.3-korg