Merge "Cleaned up content of MsoLogger"
authorSteve Smokowski <ss835w@att.com>
Thu, 14 Mar 2019 13:37:00 +0000 (13:37 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 14 Mar 2019 13:37:00 +0000 (13:37 +0000)
32 files changed:
adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java
adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml
adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/vnfmadapter.yaml [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironmentTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidationTest.java
mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java
mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/OperationalEnvServiceModelStatusTest.java
mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java

index efb5932..304b025 100644 (file)
@@ -218,11 +218,17 @@ public class RequestsDbClientTest {
     }
 
     @Test
-    public void findOneByOperationalEnvIdAndServiceModelVersionIdTest(){
-        OperationalEnvServiceModelStatus operationalEnvServiceModelStatus =requestsDbClient.findOneByOperationalEnvIdAndServiceModelVersionId("1234","TEST1234");
+    public void findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestIdTest(){
+        OperationalEnvServiceModelStatus operationalEnvServiceModelStatus =requestsDbClient.findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId("1234","TEST1234", "00032ab7-3fb3-42e5-965d-8ea592502017");
         assertNotNull(operationalEnvServiceModelStatus);
         assertEquals("1234",operationalEnvServiceModelStatus.getOperationalEnvId());
         assertEquals("TEST1234",operationalEnvServiceModelStatus.getServiceModelVersionId());
+        
+        OperationalEnvServiceModelStatus operationalEnvServiceModelStatus1 =requestsDbClient.findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId("1234","TEST1235", "00032ab7-3fb3-42e5-965d-8ea592502018");
+        assertNotNull(operationalEnvServiceModelStatus1);
+        assertEquals("00032ab7-3fb3-42e5-965d-8ea592502018",operationalEnvServiceModelStatus1.getRequestId());
+        assertEquals("1234",operationalEnvServiceModelStatus1.getOperationalEnvId());
+        assertEquals("TEST1235",operationalEnvServiceModelStatus1.getServiceModelVersionId());        
     }
 
     @Test
@@ -238,5 +244,7 @@ public class RequestsDbClientTest {
         OperationalEnvDistributionStatus operationalEnvDistributionStatus =requestsDbClient.getDistributionStatusById("111");
         assertNotNull(operationalEnvDistributionStatus);
         assertEquals("111",operationalEnvDistributionStatus.getDistributionId());
+        assertEquals("ERROR",operationalEnvDistributionStatus.getDistributionIdErrorReason());
+        assertEquals("00032ab7-3fb3-42e5-965d-8ea592502017",operationalEnvDistributionStatus.getRequestId());        
     }
 }
index de1ae85..48d5895 100644 (file)
@@ -43,6 +43,9 @@ VALUES
 INSERT INTO activate_operational_env_service_model_distribution_status (OPERATIONAL_ENV_ID, SERVICE_MODEL_VERSION_ID, REQUEST_ID,SERVICE_MOD_VER_FINAL_DISTR_STATUS,RECOVERY_ACTION,RETRY_COUNT_LEFT,WORKLOAD_CONTEXT, CREATE_TIME, MODIFY_TIME)
 VALUES
 ('1234', 'TEST1235', '00032ab7-3fb3-42e5-965d-8ea592502017', "Test", "Test", 2, 'DEFAULT', '2018-08-14 16:50:59',  '2018-08-14 16:50:59');
+INSERT INTO activate_operational_env_service_model_distribution_status (OPERATIONAL_ENV_ID, SERVICE_MODEL_VERSION_ID, REQUEST_ID,SERVICE_MOD_VER_FINAL_DISTR_STATUS,RECOVERY_ACTION,RETRY_COUNT_LEFT,WORKLOAD_CONTEXT, CREATE_TIME, MODIFY_TIME)
+VALUES
+('1234', 'TEST1235', '00032ab7-3fb3-42e5-965d-8ea592502018', "Test", "Test", 2, 'DEFAULT', '2018-08-14 16:50:59',  '2018-08-14 16:50:59');
 
 INSERT INTO `activate_operational_env_per_distributionid_status` (`DISTRIBUTION_ID`, `DISTRIBUTION_ID_STATUS`, `DISTRIBUTION_ID_ERROR_REASON`, `CREATE_TIME`, `MODIFY_TIME`, `OPERATIONAL_ENV_ID`, `SERVICE_MODEL_VERSION_ID`, `REQUEST_ID`)
 VALUES
index c24c45c..56d4257 100644 (file)
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <gson-fire-version>1.8.2</gson-fire-version>
+        <retrofit-version>2.3.0</retrofit-version>
+        <threetenbp-version>1.3.5</threetenbp-version>
+        <oltu-version>1.0.1</oltu-version>
+        <swagger-core-version>1.5.15</swagger-core-version>
     </properties>
     <name>mso-vnfm-adapter-api</name>
     <description>MSO VNFM adapter API</description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>io.swagger</groupId>
+                <artifactId>swagger-codegen-maven-plugin</artifactId>
+                <version>2.3.1</version>
+                <executions>
+                    <execution>
+                        <id>vnfmadapter</id>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <inputSpec>${basedir}/src/main/resources/vnfmadapter.yaml</inputSpec>
+                            <language>java</language>
+                            <library>retrofit2</library>
+                            <output>${project.build.directory}/generated-sources/vnfmadapter</output>
+                            <apiPackage>org.onap.vnfmadapter.v1.api</apiPackage>
+                            <modelPackage>org.onap.vnfmadapter.v1.model</modelPackage>
+                            <configOptions>
+                                <jackson>true</jackson>
+                                <sourceFolder>src/gen/java/main</sourceFolder>
+                                <withXml>true</withXml>
+                                <useRxJava2>true</useRxJava2>
+                            </configOptions>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+            <version>${swagger-core-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.retrofit2</groupId>
+            <artifactId>converter-gson</artifactId>
+            <version>${retrofit-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.retrofit2</groupId>
+            <artifactId>retrofit</artifactId>
+            <version>${retrofit-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.retrofit2</groupId>
+            <artifactId>converter-scalars</artifactId>
+            <version>${retrofit-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.oltu.oauth2</groupId>
+            <artifactId>org.apache.oltu.oauth2.client</artifactId>
+            <version>${oltu-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>io.gsonfire</groupId>
+            <artifactId>gson-fire</artifactId>
+            <version>${gson-fire-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.threeten</groupId>
+            <artifactId>threetenbp</artifactId>
+            <version>${threetenbp-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>io.reactivex.rxjava2</groupId>
+            <artifactId>rxjava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.retrofit2</groupId>
+            <artifactId>adapter-rxjava2</artifactId>
+            <version>${retrofit-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+        </dependency>
+    </dependencies>
 </project>
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/vnfmadapter.yaml b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/vnfmadapter.yaml
new file mode 100644 (file)
index 0000000..dc5f85e
--- /dev/null
@@ -0,0 +1,522 @@
+swagger: '2.0'
+info:
+  version: 1.0.0
+  title: ONAP SO VNFM Adapter API
+  description: >-
+    Describes the API between SO (Service Orchestrator) and the adapter for VNFM
+    (Virtual Network Function Manager)
+basePath: /so/vnfm-adapter/v1
+schemes:
+  - http
+  - https
+consumes:
+  - application/json
+produces:
+  - application/json
+paths:
+  '/vnfs/{vnfId}':
+    post:
+      tags:
+        - SO VNFM Adapter
+      summary: VNF create
+      description: Create a VNF instance using a VNFM.
+      operationId: vnf_create
+      consumes:
+        - application/json
+      parameters:
+        - required: true
+          type: string
+          description: >-
+            The identifier of the VNF. This must be the vnf-id of an existing
+            generic-vnf in AAI.
+          name: vnfId
+          in: path
+        - in: body
+          name: body
+          description: VNF creation parameters
+          required: true
+          schema:
+            $ref: '#/definitions/CreateVnfRequest'
+        - name: X-ONAP-RequestID
+          description: >-
+            Used to track REST requests for logging purposes. Identifies a
+            single top level invocation of ONAP
+          in: header
+          required: true
+          type: string
+        - name: X-InvocationID
+          description: >-
+            Used to track REST requests for logging purposes. Identifies a
+            single invocation of a single component
+          in: header
+          required: true
+          type: string
+      responses:
+        '202':
+          description: >-
+            The request was accepted for processing, but the processing has not
+            been completed.
+          schema:
+            $ref: '#/definitions/CreateVnfResponse'
+        '400':
+          description: >-
+            An error occurred in the VNFM adapter relating to the given input,
+            for example, if the definition of the given VNF in AAI does not
+            included required information.
+        '404':
+          description: A VNF with the specified ID was not found in AAI.
+        '500':
+          description: >-
+            An error occurred in the VNFM adapter not relating to the given
+            input, or an error is received from the VNFM.
+    delete:
+      tags:
+        - SO VNFM Adapter
+      summary: VNF delete
+      description: Delete an instance of a VNF using a VNFM.
+      operationId: vnf_delete
+      consumes:
+        - application/json
+      parameters:
+        - required: true
+          type: string
+          description: >-
+            The identifier of the VNF. This must be the vnf-id of an existing
+            generic-vnf in AAI
+          name: vnfId
+          in: path
+        - name: X-ONAP-RequestID
+          description: >-
+            Used to track REST requests for logging purposes. Identifies a
+            single top level invocation of ONAP
+          in: header
+          required: true
+          type: string
+        - name: X-InvocationID
+          description: >-
+            Used to track REST requests for logging purposes. Identifies a
+            single invocation of a single component
+          in: header
+          required: true
+          type: string
+      responses:
+        '202':
+          description: >-
+            The request was accepted for processing, but the processing has not
+            been completed.
+          schema:
+            $ref: '#/definitions/DeleteVnfResponse'
+        '400':
+          description: >-
+            An error occurred in the VNFM adapter relating to the given input,
+            for example, if the definition of the given VNF in AAI does not
+            included required information.
+        '404':
+          description: A VNF with the specified ID was not found in AAI.
+        '500':
+          description: >-
+            An error occurred in the VNFM adapter not relating to the given
+            input, or an error is received from the VNFM.
+  '/jobs/{jobId}':
+    get:
+      tags:
+        - SO VNFM Adapter
+      summary: Job query
+      description: Query the status of a job.
+      operationId: job_query
+      consumes:
+        - application/json
+      produces:
+        - application/json
+      parameters:
+        - required: true
+          type: string
+          description: The identifier of the Job.
+          name: jobId
+          in: path
+        - name: X-ONAP-RequestID
+          description: >-
+            Used to track REST requests for logging purposes. Identifies a
+            single top level invocation of ONAP
+          in: header
+          required: true
+          type: string
+        - name: X-InvocationID
+          description: >-
+            Used to track REST requests for logging purposes. Identifies a
+            single invocation of a single component
+          in: header
+          required: true
+          type: string
+      responses:
+        '200':
+          description: ''
+          schema:
+            $ref: '#/definitions/QueryJobResponse'
+        '404':
+          description: A job with the specified ID was not found.
+        '500':
+          description: >-
+            An error occurred in the VNFM adapter not relating to the given
+            input, or an error is received from the VNFM.
+definitions:
+  CreateVnfRequest:
+    type: object
+    properties:
+      name:
+        type: string
+        description: The name to be applied to the VNF.
+      tenant:
+        $ref: '#/definitions/Tenant'
+      additionalParams:
+        type: object
+        description: >-
+          Additional input parameters for the instantiation process, specific to
+          the VNF being instantiated, as declared in the VNFD as part of
+          "InstantiateVnfOpConfig".
+        additionalProperties:
+          type: string
+      externalVirtualLinks:
+        type: array
+        description: Information about external VLs to connect the VNF to.
+        items:
+          $ref: '#/definitions/ExternalVirtualLink'
+    required:
+      - name
+      - tenant
+  Tenant:
+    type: object
+    description: Details of the tenant that VNFs can be deployed into
+    properties:
+      cloudOwner:
+        type: string
+        description: The owner in AAI of the cloud to which the tenant belongs.
+      regionName:
+        type: string
+        description: The regionName in AAI of the cloud to which the tenant belongs.
+      tenantId:
+        type: string
+        description: The identifier of the tenant in the VIM.
+    required:
+      - cloudOwner
+      - regionName
+      - tenantId
+  CreateVnfResponse:
+    type: object
+    properties:
+      jobId:
+        description: The ID of the job which can be used to query the status of the job
+        type: string
+    required:
+      - jobId
+  DeleteVnfResponse:
+    type: object
+    properties:
+      jobId:
+        description: >-
+          The ID of the job which can be used to query the status of the delete
+          job
+        type: string
+    required:
+      - jobId
+  QueryJobResponse:
+    type: object
+    properties:
+      operationStatusRetrievalStatus:
+        $ref: '#/definitions/OperationStatusRetrievalStatusEnum'
+      id:
+        type: string
+      operation:
+        $ref: '#/definitions/OperationEnum'
+      operationState:
+        $ref: '#/definitions/OperationStateEnum'
+      startTime:
+        type: string
+        format: date-time
+      stateEnteredTime:
+        type: string
+        format: date-time
+      vnfInstanceId:
+        type: string
+    required:
+      - operationStatusRetrievalStatus
+  OperationStatusRetrievalStatusEnum:
+    description: The status of the attempt to retrrieve the operation from the VNFM
+    type: string
+    enum:
+      - STATUS_FOUND
+      - WAITING_FOR_STATUS
+      - OPERATION_NOT_FOUND
+      - CANNOT_RETRIEVE_STATUS
+  OperationEnum:
+    description: The operation
+    type: string
+    enum:
+      - INSTANTIATE
+      - SCALE
+      - SCALE_TO_LEVEL
+      - CHANGE_FLAVOUR
+      - TERMINATE
+      - HEAL
+      - OPERATE
+      - CHANGE_EXT_CONN
+      - MODIFY_INFO
+  OperationStateEnum:
+    description: The status of the operation
+    type: string
+    enum:
+      - STARTING
+      - PROCESSING
+      - COMPLETED
+      - FAILED_TEMP
+      - FAILED
+      - ROLLING_BACK
+      - ROLLED_BACK
+  ExternalVirtualLink:
+    description: |
+      This type represents an external VL.
+    type: object
+    required:
+      - id
+      - resourceId
+      - extCps
+    properties:
+      id:
+        description: |
+          An identifier with the intention of being globally unique.
+        type: string
+      tenant:
+        $ref: '#/definitions/Tenant'
+      resourceId:
+        description: |
+          An identifier maintained by the VIM.
+        type: string
+      extCps:
+        description: |
+          External CPs of the VNF to be connected to this external VL.
+        type: array
+        items:
+          description: >
+            This type represents configuration information for external CPs
+            created from a CPD.
+          type: object
+          required:
+            - cpdId
+          properties:
+            cpdId:
+              description: |
+                An identifier that is unique within a VNF descriptor.
+              type: string
+            cpConfig:
+              description: >
+                List of instance data that need to be configured on the CP
+                instances created from the respective CPD.
+              type: array
+              items:
+                description: >
+                  This type represents an externally provided link port or
+                  network address information per instance of an external
+                  connection point. In case a link port is provided, the VNFM
+                  shall use that link port when connecting the external CP to
+                  the external VL. In a link port is not provided, the VNFM
+                  shall create a link port on the external VL, and use that link
+                  port to connect the external CP to the external VL.
+                type: object
+                properties:
+                  cpInstanceId:
+                    description: >
+                      An identifier that is unique for the respective type
+                      within a VNF instance, but may not be globally unique.
+                    type: string
+                  linkPortId:
+                    description: |
+                      An identifier with the intention of being globally unique.
+                    type: string
+                  cpProtocolData:
+                    description: >
+                      Parameters for configuring the network protocols on the
+                      link port that connects the CP to a VL.  The following
+                      conditions apply to the attributes "linkPortId" and
+                      "cpProtocolData":  * The "linkPortId" and "cpProtocolData"
+                      attributes shall both be  absent for the deletion of an
+                      existing external CP instance
+                        addressed by cpInstanceId. 
+                      * At least one of these attributes shall be present for a 
+                      to-be-created external CP instance or an existing external
+                        CP instance.
+                      * If the "linkPortId" attribute is absent, the VNFM shall
+                      create a  link port.
+
+                      * If the "cpProtocolData" attribute is absent, the
+                      "linkPortId"  attribute shall be provided referencing a
+                      pre-created link port,
+                        and the VNFM can use means outside the scope of the present
+                        document to obtain the pre-configured address information for the
+                        connection point from the resource representing the link port.
+                      * If both "cpProtocolData" and "linkportId" are provided,
+                      the API  consumer shall ensure that the cpProtocolData can
+                      be used with the
+                        pre-created link port referenced by "linkPortId".
+                    type: array
+                    items:
+                      description: |
+                        This type represents network protocol data.
+                      type: object
+                      required:
+                        - layerProtocol
+                      properties:
+                        layerProtocol:
+                          description: >
+                            Identifier of layer(s) and protocol(s). This
+                            attribute allows to signal the addition of further
+                            types of layer and protocol in future versions of
+                            the present document in a backwards-compatible way.
+                            In the current version of the present document, only
+                            IP over Ethernet is supported.
+                          type: string
+                          enum:
+                            - IP_OVER_ETHERNET
+                        ipOverEthernet:
+                          description: >
+                            This type represents network address data for IP
+                            over Ethernet.
+                          type: object
+                          properties:
+                            macAddress:
+                              description: >
+                                A MAC address. Representation: string that
+                                consists of groups of two hexadecimal digits,
+                                separated by hyphens or colons.
+                              type: string
+                              format: MAC
+                            ipAddresses:
+                              description: >
+                                List of IP addresses to assign to the CP
+                                instance. Each entry represents IP address data
+                                for fixed or dynamic IP address assignment per
+                                subnet. If this attribute is not present, no IP
+                                address shall be assigned.
+                              type: array
+                              items:
+                                type: object
+                                required:
+                                  - type
+                                properties:
+                                  type:
+                                    description: >
+                                      The type of the IP addresses. Permitted
+                                      values: IPV4, IPV6.
+                                    type: string
+                                    enum:
+                                      - IPV4
+                                      - IPV6
+                                  fixedAddresses:
+                                    description: >
+                                      Fixed addresses to assign (from the subnet
+                                      defined by "subnetId" if provided).
+                                      Exactly one of "fixedAddresses",
+                                      "numDynamicAddresses" or "ipAddressRange"
+                                      shall be present.
+                                    type: array
+                                    items:
+                                      description: >
+                                        An IPV4 or IPV6 address. Representation:
+                                        In case of an IPV4 address, string that
+                                        consists of four decimal integers
+                                        separated by dots, each integer ranging
+                                        from 0 to 255. In case of an IPV6
+                                        address, string that  consists of groups
+                                        of zero to four hexadecimal digits,
+                                        separated by colons.
+                                      type: string
+                                      format: IP
+                                  numDynamicAddresses:
+                                    description: >
+                                      Number of dynamic addresses to assign
+                                      (from the subnet defined by "subnetId" if
+                                      provided). Exactly one of
+                                      "fixedAddresses", "numDynamicAddresses" or
+                                      "ipAddressRange" shall be present.
+                                    type: integer
+                                  addressRange:
+                                    description: >
+                                      An IP address range to be used, e.g. in
+                                      case of egress connections. In case this
+                                      attribute is present, IP addresses from
+                                      the range will be used.
+                                    type: object
+                                    required:
+                                      - minAddress
+                                      - maxAddress
+                                    properties:
+                                      minAddress:
+                                        description: >
+                                          An IPV4 or IPV6 address. Representation:
+                                          In case of an IPV4 address, string that
+                                          consists of four decimal integers
+                                          separated by dots, each integer ranging
+                                          from 0 to 255. In case of an IPV6
+                                          address, string that  consists of groups
+                                          of zero to four hexadecimal digits,
+                                          separated by colons.
+                                        type: string
+                                        format: IP
+                                      maxAddress:
+                                        description: >
+                                          An IPV4 or IPV6 address. Representation:
+                                          In case of an IPV4 address, string that
+                                          consists of four decimal integers
+                                          separated by dots, each integer ranging
+                                          from 0 to 255. In case of an IPV6
+                                          address, string that  consists of groups
+                                          of zero to four hexadecimal digits,
+                                          separated by colons.
+                                        type: string
+                                        format: IP
+                                  subnetId:
+                                    description: >
+                                      An identifier maintained by the VIM or
+                                      other resource provider. It is expected to
+                                      be unique within the VIM instance.
+                                    type: string
+      extLinkPorts:
+        description: >
+          Externally provided link ports to be used to connect external
+          connection points to this external VL. If this attribute is not
+          present, the VNFM shall create the link ports on the external VL.
+        type: array
+        items:
+          description: >
+            This type represents an externally provided link port to be used to
+            connect an external connection point to an external VL.
+          type: object
+          required:
+            - id
+            - resourceHandle
+          properties:
+            id:
+              description: |
+                An identifier with the intention of being globally unique.
+              type: string
+            resourceHandle:
+              required:
+                - tenant
+                - resourceId
+              type: object
+              description: >
+                This type represents the information that allows addressing a
+                virtualised resource that is used by a VNF instance.
+              properties:
+                tenant:
+                  $ref: '#/definitions/Tenant'
+                resourceId:
+                  description: >
+                    An identifier maintained by the VIM or other resource
+                    provider. It is expected to be unique within the VIM
+                    instance.
+                  type: string
+                vimLevelResourceType:
+                  description: >
+                    Type of the resource in the scope of the VIM or the resource
+                    provider.
+                  type: string
\ No newline at end of file
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn
new file mode 100644 (file)
index 0000000..1aaa920
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFLockActivity" name="VNFLockActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFLockActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFLockActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFLockActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskLock" targetRef="VNFLockActivity_End" />
+    <bpmn:serviceTask id="TaskLock" name="VNF Lock" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionLock&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskLock" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFLockActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFLockActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFLockActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskLock">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn
new file mode 100644 (file)
index 0000000..8115f69
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFSnapShotActivity" name="VNFSnapShotActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFSnapShotActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFSnapShotActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFSnapShotActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskSnapShot" targetRef="VNFSnapShotActivity_End" />
+    <bpmn:serviceTask id="TaskSnapShot" name="VNF SnapShot" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionSnapshot&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskSnapShot" />
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFSnapShotActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFSnapShotActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFSnapShotActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskSnapShot">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn
new file mode 100644 (file)
index 0000000..f0490a9
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFStartActivity" name="VNFStartActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFStartActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFStartActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFStartActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskStart" targetRef="VNFStartActivity_End" />
+    <bpmn:serviceTask id="TaskStart" name="VNF Start" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionStart&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskStart" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFStartActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFStartActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFStartActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskStart">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn
new file mode 100644 (file)
index 0000000..0e02295
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFStopActivity" name="VNFStopActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFStopActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFStopActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFStopActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskStop" targetRef="VNFStopActivity_End" />
+    <bpmn:serviceTask id="TaskStop" name="VNF Stop" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionStop&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskStop" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFStopActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFStopActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFStopActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskStop">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn
new file mode 100644 (file)
index 0000000..6d1b68c
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFUnlockActivity" name="VNFUnlockActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFUnlockActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFUnlockActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUnlockActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUnlock" targetRef="VNFUnlockActivity_End" />
+    <bpmn:serviceTask id="TaskUnlock" name="VNF Unlock" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUnlock&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUnlock" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFUnlockActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFUnlockActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFUnlockActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskUnlock">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn
new file mode 100644 (file)
index 0000000..dfcf997
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFUpgradeBackupActivity" name="VNFUpgradeBackupActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFUpgradeBackupActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFUpgradeBackupActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUpgradeBackupActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUpgradeBackup" targetRef="VNFUpgradeBackupActivity_End" />
+    <bpmn:serviceTask id="TaskUpgradeBackup" name="VNF UpgradeBackup" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUpgradeBackup&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUpgradeBackup" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFUpgradeBackupActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFUpgradeBackupActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFUpgradeBackupActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskUpgradeBackup">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
index 9c745fd..8e76f8f 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -44,8 +43,8 @@ public class VNFHealthCheckActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFHealthCheckActivity_Test() throws Exception {
+               variables.put("actionHealthCheck", Action.HealthCheck);
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables);
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java
new file mode 100644 (file)
index 0000000..f36a72f
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFLockActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFLockActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFLockActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskLock",                                                                
+                               "VNFLockActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test   
+       public void rainyDayVNFLockActivity_Test() throws Exception {
+               variables.put("actionLock", Action.Lock);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables);
+               assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFLockActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskLock").hasNotPassed(                                                                  
+                               "VNFLockActivity_End");         
+       }
+       
+}
index e8d603e..2d9b952 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -44,8 +43,8 @@ public class VNFQuiesceTrafficActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFQuiesceTrafficActivity_Test() throws Exception {
+               variables.put("actionQuiesceTraffic", Action.QuiesceTraffic);
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables);
index 75ff1eb..d541cdf 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -44,8 +43,8 @@ public class VNFResumeTrafficActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFResumeTrafficActivity_Test() throws Exception {
+               variables.put("actionResumeTraffic", Action.ResumeTraffic);
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables);
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java
new file mode 100644 (file)
index 0000000..f6bfd04
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFSnapShotActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFSnapShotActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFSnapShotActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskSnapShot",                                                            
+                               "VNFSnapShotActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test   
+       public void rainyDayVNFSnapShotActivity_Test() throws Exception {
+               variables.put("actionSnapshot", Action.Snapshot);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables);
+               assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFSnapShotActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskSnapShot").hasNotPassed(                                                              
+                               "VNFSnapShotActivity_End");             
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java
new file mode 100644 (file)
index 0000000..6e4be69
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFStartActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFStartActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFStartActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskStart",                                                               
+                               "VNFStartActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test   
+       public void rainyDayVNFStartActivity_Test() throws Exception {
+               variables.put("actionStart", Action.Start);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables);
+               assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFStartActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskStart").hasNotPassed(                                                                 
+                               "VNFStartActivity_End");                
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java
new file mode 100644 (file)
index 0000000..3bc5940
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFStopActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFStopActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFStopActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskStop",                                                                
+                               "VNFStopActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test   
+       public void rainyDayVNFStopActivity_Test() throws Exception {
+               variables.put("actionStop", Action.Stop);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables);
+               assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFStopActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskStop").hasNotPassed(                                                                  
+                               "VNFStopActivity_End");         
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java
new file mode 100644 (file)
index 0000000..d0db70b
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFUnlockActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFUnlockActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUnlockActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUnlock",                                                              
+                               "VNFUnlockActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test   
+       public void rainyDayVNFUnlockActivity_Test() throws Exception {
+               variables.put("actionUnlock", Action.Unlock);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables);
+               assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUnlockActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUnlock").hasNotPassed(                                                                
+                               "VNFUnlockActivity_End");               
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java
new file mode 100644 (file)
index 0000000..c68196c
--- /dev/null
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFUpgradeBackupActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFUpgradeBackupActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeBackupActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUpgradeBackup",                                                               
+                               "VNFUpgradeBackupActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test
+       public void rainyDayVNFUpgradeBackupActivity_Test() throws Exception {
+               variables.put("actionUpgradeBackup", Action.UpgradeBackup);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeBackupActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUpgradeBackup").hasNotPassed(                                                                 
+                               "VNFUpgradeBackupActivity_End");                
+               assertThat(pi).isEnded();
+       }
+       
+}
index b3976ad..5fa9307 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -43,8 +42,9 @@ public class VNFUpgradePostCheckActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFUpgradePostCheckActivity_Test() throws Exception {
+               variables.put("actionUpgradePostCheck", Action.UpgradePostCheck);
+               
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables);
index 15f314b..40f5df8 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -44,8 +43,8 @@ public class VNFUpgradePreCheckActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFUpgradePreCheckActivity_Test() throws Exception {
+               variables.put("actionUpgradePreCheck", Action.UpgradePreCheck);
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables);
index 11f88d2..91e6bf4 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -44,8 +43,8 @@ public class VNFUpgradeSoftwareActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFUpgradeSoftwareActivity_Test() throws Exception {
+               variables.put("actionUpgradeSoftware", Action.UpgradeSoftware);
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables);
index 5ed84e0..4b4b3ec 100644 (file)
@@ -68,6 +68,7 @@ public class AppcRunTasks {
                execution.setVariable("actionResumeTraffic", Action.ResumeTraffic);             
                execution.setVariable("actionStop", Action.Stop);
                execution.setVariable("actionStart", Action.Start);
+               execution.setVariable("actionHealthCheck", Action.HealthCheck);
                execution.setVariable("rollbackVnfStop", false);
                execution.setVariable("rollbackVnfLock", false);
                execution.setVariable("rollbackQuiesceTraffic", false);
index 2dab494..ec1c4cb 100644 (file)
@@ -1125,12 +1125,16 @@ public class ServiceInstances {
        mapper.setSerializationInclusion(Include.NON_NULL);     
        if(msoRawRequest != null){
                ServiceInstancesRequest sir = mapper.readValue(msoRawRequest, ServiceInstancesRequest.class);           
-               if(     !isAlaCarte && Action.createInstance.equals(action) && serviceInstRequest != null && 
+               if(     serviceInstRequest != null && 
                        serviceInstRequest.getRequestDetails() != null && 
                        serviceInstRequest.getRequestDetails().getRequestParameters() != null) {
-                       sir.getRequestDetails().setCloudConfiguration(serviceInstRequest.getRequestDetails().getCloudConfiguration());
-                       sir.getRequestDetails().getRequestParameters().setUserParams(serviceInstRequest.getRequestDetails().getRequestParameters().getUserParams());
+                       if(     !isAlaCarte && Action.createInstance.equals(action)) {
+                               sir.getRequestDetails().setCloudConfiguration(serviceInstRequest.getRequestDetails().getCloudConfiguration());
+                               sir.getRequestDetails().getRequestParameters().setUserParams(serviceInstRequest.getRequestDetails().getRequestParameters().getUserParams());
+                       }
+                       sir.getRequestDetails().getRequestParameters().setUsePreload(serviceInstRequest.getRequestDetails().getRequestParameters().getUsePreload());
                }
+               
                logger.debug("Value as string: {}", mapper.writeValueAsString(sir));
                return mapper.writeValueAsString(sir);
        }
index 31c65e1..9303e12 100644 (file)
@@ -82,7 +82,6 @@ public class SDCClientHelper {
 
                try {
                        String urlString = this.buildUriBuilder(serviceModelVersionId, operationalEnvironmentId);
-                       logger.debug("Url ASDC Activate request: {}", urlString);
                        String jsonPayload = this.buildJsonWorkloadContext(workloadContext);
                        String basicAuthCred = getBasicAuth();
 
@@ -158,7 +157,6 @@ public class SDCClientHelper {
                        enhancedAsdcResponseJsonObj.put("statusCode", Integer.toString(statusCode));
                        enhancedAsdcResponseJsonObj.put("messageId", "");
                        enhancedAsdcResponseJsonObj.put("message", "Success");
-                       logger.debug("Url ASDC Activate response: {} {}", "distributionId ", sdcResponseJsonObj.get("distributionId"));
 
                } else {  // error
                        if (sdcResponseJsonObj.has("requestError") ) {
index 219a2ef..352bf8f 100644 (file)
@@ -86,26 +86,31 @@ public class ActivateVnfStatusOperationalEnvironment {
         */
        public void execute(String requestId, CloudOrchestrationRequest request) throws ApiException {
 
-
-               String operationalEnvironmentId = "";
+                try {
+               
+                       String operationalEnvironmentId = "";
 
                        String sdcDistributionId = request.getDistributionId();
                        Distribution sdcStatus = request.getDistribution();
 
-                       // Distribution, Query for operationalEnvironmentId, serviceModelVersionId
+                       // Distribution, Query for operationalEnvironmentId, serviceModelVersionId, origRequestId
                        this.queryDistributionDbResponse = client.getDistributionStatusById(sdcDistributionId);
                        operationalEnvironmentId = this.queryDistributionDbResponse.getOperationalEnvId();
+                       this.origRequestId = this.queryDistributionDbResponse.getRequestId();
                        
-                       // ServiceModel, Query for dbRequestId, recoveryAction, retryCountString
-                       this.queryServiceModelResponse = client.findOneByOperationalEnvIdAndServiceModelVersionId(operationalEnvironmentId, queryDistributionDbResponse.getServiceModelVersionId());
-                       this.origRequestId = this.queryServiceModelResponse.getRequestId();
-                       
+                       // ServiceModel, Query for recoveryAction, retryCountString
+                       this.queryServiceModelResponse = client.findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId(operationalEnvironmentId, queryDistributionDbResponse.getServiceModelVersionId(), this.origRequestId);
+
                        processActivateSDCStatus(sdcDistributionId, sdcStatus, this.queryDistributionDbResponse, this.queryServiceModelResponse);
                        
                        // After EVERY status processed, need to query the status of all service modelId 
                        //  to determine the OVERALL status if "COMPLETE" or "FAILURE":
                        checkOrUpdateOverallStatus(operationalEnvironmentId, this.origRequestId);                       
-
+           
+                } catch(Exception e) {
+                   requestDb.updateInfraFailureCompletion(e.getMessage(), this.origRequestId, this.queryDistributionDbResponse.getOperationalEnvId());
+        }
+                       
        }
        
        /**
@@ -161,13 +166,11 @@ public class ActivateVnfStatusOperationalEnvironment {
                                                }
                                                
                                                sdcStatusValue = modifiedStatus;
-                                           // should update 1 row, modified status & retryCount set 0
                                                OperationalEnvServiceModelStatus updateRetryCountZeroAndStatus = 
                                                                dbHelper.updateRetryCountAndStatusInOperationalEnvServiceModelStatus(queryServiceModelResponse, 
                                                                                                                                                                                                         modifiedStatus, 
-                                                                                                                                                                                                        RETRY_COUNT_ZERO);                                             
+                                                                                                                                                                                                        RETRY_COUNT_ZERO);
                                                client.save(updateRetryCountZeroAndStatus);
-                                               // should update 1 row, modified status
                                                OperationalEnvDistributionStatus updateDistStatus = 
                                                                dbHelper.updateStatusInOperationalEnvDistributionStatus(queryDistributionDbResponse, 
                                                                                                                                                                                modifiedStatus,
index 23974ef..d6c794e 100644 (file)
@@ -194,6 +194,24 @@ public class ServiceInstancesTest extends BaseTest{
         assertEquals("10",modelInfo.getModelUuid());
 
     }
+    
+    
+    @Test
+    public void test_mapJSONtoMSOStyleUsePreload() throws IOException{
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.setSerializationInclusion(Include.NON_NULL);
+        String testRequest= inputStream("/ServiceInstanceDefault.json");
+        ServiceInstancesRequest sir = new ServiceInstancesRequest();
+        RequestDetails rd = new RequestDetails();
+        RequestParameters rp = new RequestParameters();
+        rp.setUsePreload(true);
+        rd.setRequestParameters(rp);
+        sir.setRequestDetails(rd);
+        String resultString = servInstances.mapJSONtoMSOStyle(testRequest, sir, false, null);
+        ServiceInstancesRequest sir1 = mapper.readValue(resultString, ServiceInstancesRequest.class);
+        assertTrue(sir1.getRequestDetails().getRequestParameters().getUsePreload());
+    }
+    
     @Test
     public void createServiceInstanceVIDDefault() throws IOException{
         TestAppender.events.clear();
index 29fa1a3..a26848b 100644 (file)
@@ -109,7 +109,7 @@ public class ActivateVnfStatusOperationalEnvironmentTest extends BaseTest{
                iar.setRequestId(requestIdOrig);
                iar.setRequestStatus("PENDING");
 
-               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionId"))
+               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId"))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withBody(mapper.writeValueAsString(serviceModelDb))
                                                .withStatus(HttpStatus.SC_OK)));
@@ -134,7 +134,7 @@ public class ActivateVnfStatusOperationalEnvironmentTest extends BaseTest{
                serviceModelDb.setOperationalEnvId(operationalEnvironmentId);
                serviceModelDb.setRetryCount(retryCountZero);
                serviceModelDb.setServiceModelVersionDistrStatus(statusError);
-               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionId"))
+               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId"))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withBody(mapper.writeValueAsString(serviceModelDb))
                                                .withStatus(HttpStatus.SC_OK)));
@@ -169,7 +169,7 @@ public class ActivateVnfStatusOperationalEnvironmentTest extends BaseTest{
                serviceModelDb.setOperationalEnvId(operationalEnvironmentId);
                serviceModelDb.setRetryCount(retryCountTwo);
                serviceModelDb.setServiceModelVersionDistrStatus(statusError);
-               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionId"))
+               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId"))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withBody(mapper.writeValueAsString(serviceModelDb))
                                                .withStatus(HttpStatus.SC_OK)));
@@ -208,7 +208,7 @@ public class ActivateVnfStatusOperationalEnvironmentTest extends BaseTest{
                iar.setRequestId(requestIdOrig);
                iar.setRequestStatus("PENDING");
                
-               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionId"))
+               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId"))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withBody(mapper.writeValueAsString(serviceModelDb))
                                                .withStatus(HttpStatus.SC_OK)));
@@ -244,7 +244,7 @@ public class ActivateVnfStatusOperationalEnvironmentTest extends BaseTest{
                serviceModelDb.setOperationalEnvId(operationalEnvironmentId);
                serviceModelDb.setRetryCount(retryCountThree);
                serviceModelDb.setServiceModelVersionDistrStatus(statusError);
-               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionId"))
+               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId"))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withBody(mapper.writeValueAsString(serviceModelDb))
                                                .withStatus(HttpStatus.SC_OK)));
@@ -276,7 +276,7 @@ public class ActivateVnfStatusOperationalEnvironmentTest extends BaseTest{
                
                stubFor(post(urlPathMatching("/sdc/v1/catalog/services/.*"))
                                .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(jsonObject.toString()).withStatus(HttpStatus.SC_ACCEPTED)));
-               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionId"))
+               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId"))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withBody(mapper.writeValueAsString(serviceModelDb))
                                                .withStatus(HttpStatus.SC_OK)));
@@ -339,7 +339,7 @@ public class ActivateVnfStatusOperationalEnvironmentTest extends BaseTest{
                iar.setRequestId(requestIdOrig);
                iar.setRequestStatus("PENDING");
 
-               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionId"))
+               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId"))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withBody(mapper.writeValueAsString(serviceModelDb))
                                                .withStatus(HttpStatus.SC_OK)));
@@ -415,7 +415,7 @@ public class ActivateVnfStatusOperationalEnvironmentTest extends BaseTest{
                InfraActiveRequests iar = new InfraActiveRequests();
                iar.setRequestId(requestIdOrig);
                iar.setRequestStatus("PENDING");
-               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionId"))
+               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId"))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withBody(mapper.writeValueAsString(serviceModelDb))
                                                .withStatus(HttpStatus.SC_OK)));
@@ -477,7 +477,7 @@ public class ActivateVnfStatusOperationalEnvironmentTest extends BaseTest{
                iar.setRequestId(requestIdOrig);
                iar.setRequestStatus("PENDING");
 
-               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionId"))
+               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId"))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withBody(mapper.writeValueAsString(serviceModelDb))
                                                .withStatus(HttpStatus.SC_OK)));
@@ -536,7 +536,7 @@ public class ActivateVnfStatusOperationalEnvironmentTest extends BaseTest{
                iar.setRequestId(requestIdOrig);
                iar.setRequestStatus("PENDING");
 
-               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionId"))
+               stubFor(get(urlPathEqualTo("/operationalEnvServiceModelStatus/search/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId"))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withBody(mapper.writeValueAsString(serviceModelDb))
                                                .withStatus(HttpStatus.SC_OK)));
index 8d456e3..bd9b95d 100644 (file)
@@ -50,7 +50,7 @@ public class RequestParametersValidationTest extends BaseTest{
                sir.setServiceInstanceId("0fd90c0c-0e3a-46e2-abb5-4c4820d5985b");               
                RequestParametersValidation validation = new RequestParametersValidation();
                validation.validate(info);
-               
+               assertFalse(sir.getRequestDetails().getRequestParameters().getUsePreload());
                assertFalse(info.getReqParameters().getUsePreload());           
        }
        
@@ -66,7 +66,8 @@ public class RequestParametersValidationTest extends BaseTest{
                RequestParametersValidation validation = new RequestParametersValidation();
                validation.validate(info);
                
-               assertTrue(info.getReqParameters().getUsePreload());            
+               assertTrue(sir.getRequestDetails().getRequestParameters().getUsePreload());
+               assertTrue(info.getReqParameters().getUsePreload());
        }
        
        @Test
@@ -82,6 +83,7 @@ public class RequestParametersValidationTest extends BaseTest{
                RequestParametersValidation validation = new RequestParametersValidation();
                validation.validate(info);
                
+               assertTrue(sir.getRequestDetails().getRequestParameters().getUsePreload());
                assertTrue(info.getReqParameters().getUsePreload());
        }
        
@@ -97,7 +99,7 @@ public class RequestParametersValidationTest extends BaseTest{
                sir.setServiceInstanceId("0fd90c0c-0e3a-46e2-abb5-4c4820d5985b");               
                RequestParametersValidation validation = new RequestParametersValidation();
                validation.validate(info);
-               
+               assertTrue(sir.getRequestDetails().getRequestParameters().getUsePreload());
                assertTrue(info.getReqParameters().getUsePreload());
        }
        
@@ -113,7 +115,7 @@ public class RequestParametersValidationTest extends BaseTest{
                info.setRequestScope("service");
                RequestParametersValidation validation = new RequestParametersValidation();
                validation.validate(info);
-               
+               assertFalse(sir.getRequestDetails().getRequestParameters().getUsePreload());
                assertFalse(info.getReqParameters().getUsePreload());           
        }
        
@@ -129,7 +131,7 @@ public class RequestParametersValidationTest extends BaseTest{
                info.setRequestScope("service");
                RequestParametersValidation validation = new RequestParametersValidation();
                validation.validate(info);
-               
+               assertFalse(sir.getRequestDetails().getRequestParameters().getUsePreload());
                assertFalse(info.getReqParameters().getUsePreload());           
        }
        
@@ -145,7 +147,7 @@ public class RequestParametersValidationTest extends BaseTest{
                info.setRequestScope("service");
                RequestParametersValidation validation = new RequestParametersValidation();
                validation.validate(info);
-               
+               assertTrue(sir.getRequestDetails().getRequestParameters().getUsePreload());
                assertTrue(info.getReqParameters().getUsePreload());
        }
        
@@ -161,7 +163,7 @@ public class RequestParametersValidationTest extends BaseTest{
                info.setRequestScope("service");
                RequestParametersValidation validation = new RequestParametersValidation();
                validation.validate(info);
-               
+               assertTrue(sir.getRequestDetails().getRequestParameters().getUsePreload());
                assertTrue(info.getReqParameters().getUsePreload());
        }       
 }
index bcad9ce..ecf1dcb 100644 (file)
@@ -37,7 +37,8 @@ public interface OperationalEnvServiceModelStatusRepository extends JpaRepositor
        public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndRequestId(String operationalEnvId, String requestId);
        public List<OperationalEnvServiceModelStatus> findAllByOperationalEnvIdAndRequestId(@Param("OPERATIONAL_ENV_ID") String operationalEnvId, 
                                                                                                                                                                                @Param("REQUEST_ID") String requestId);
-       public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndServiceModelVersionId(@Param("OPERATIONAL_ENV_ID") String operationalEnvId, 
-                                                                                                                                                                                         @Param("SERVICE_MODEL_VERSION_ID") String serviceModelVersionId);
+       public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId(@Param("OPERATIONAL_ENV_ID") String operationalEnvId, 
+                                                                                                          @Param("SERVICE_MODEL_VERSION_ID") String serviceModelVersionId,
+                                                                                                          @Param("REQUEST_ID") String requestId);
        
 }
index ef34662..9eec860 100644 (file)
@@ -54,8 +54,9 @@ public class OperationalEnvServiceModelStatusTest {
                status.setRetryCount(0);
                
                repository.saveAndFlush(status);
-               OperationalEnvServiceModelStatus status2 = repository.findOneByOperationalEnvIdAndServiceModelVersionId("oper-env-id-1", "service-model-ver-id-1");
+               OperationalEnvServiceModelStatus status2 = repository.findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId("oper-env-id-1", "service-model-ver-id-1", "request-id-1");
                status2.setRetryCount(1);
+               assertEquals("request-id-1", status2.getRequestId());           
                
                repository.saveAndFlush(status2);
                
index b809691..5958397 100644 (file)
@@ -96,7 +96,7 @@ public class RequestsDbClient {
        
        private String findOneByServiceIdAndOperationIdURI = "/findOneByServiceIdAndOperationId";
        
-       private String findOneByOperationalEnvIdAndServiceModelVersionIdURI = "/findOneByOperationalEnvIdAndServiceModelVersionId";
+       private String findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestIdURI = "/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId";
        
        private String findAllByOperationalEnvIdAndRequestIdURI = "/findAllByOperationalEnvIdAndRequestId";
 
@@ -123,7 +123,7 @@ public class RequestsDbClient {
                findOneByServiceIdAndOperationIdURI = endpoint + OPERATION_STATUS_SEARCH + findOneByServiceIdAndOperationIdURI;
                requestProcessingDataURI = endpoint + requestProcessingDataURI;
                operationalEnvDistributionStatusURI = endpoint + operationalEnvDistributionStatusURI;
-               findOneByOperationalEnvIdAndServiceModelVersionIdURI = endpoint + OPERATIONAL_ENV_SERVICE_MODEL_STATUS_SEARCH + findOneByOperationalEnvIdAndServiceModelVersionIdURI;
+               findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestIdURI = endpoint + OPERATIONAL_ENV_SERVICE_MODEL_STATUS_SEARCH + findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestIdURI;
                findAllByOperationalEnvIdAndRequestIdURI = endpoint + OPERATIONAL_ENV_SERVICE_MODEL_STATUS_SEARCH + findAllByOperationalEnvIdAndRequestIdURI;
        }
        
@@ -227,16 +227,18 @@ public class RequestsDbClient {
                }
        }
 
-       public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndServiceModelVersionId(String operationalEnvironmentId, String serviceModelVersionId) {
+       public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId(String operationalEnvironmentId, String serviceModelVersionId, String requestId) {
                try {
                        HttpEntity<?> entity = getHttpEntity();
-                       OperationalEnvServiceModelStatus modelStatus = restTemplate.exchange(getUri(UriBuilder.fromUri(findOneByOperationalEnvIdAndServiceModelVersionIdURI)
+                       OperationalEnvServiceModelStatus modelStatus = restTemplate.exchange(getUri(UriBuilder.fromUri(findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestIdURI)
                                        .queryParam(OPERATIONAL_ENVIRONMENT_ID, operationalEnvironmentId)
                                        .queryParam(SERVICE_MODEL_VERSION_ID, serviceModelVersionId)
+                                       .queryParam(REQUEST_ID, requestId)                                      
                                        .build().toString()), HttpMethod.GET, entity, OperationalEnvServiceModelStatus.class).getBody();
                        if (null != modelStatus) {
                                modelStatus.setOperationalEnvId(operationalEnvironmentId);
                                modelStatus.setServiceModelVersionId(serviceModelVersionId);
+                               modelStatus.setRequestId(requestId);                            
                        }
                        return modelStatus;
                }catch(HttpClientErrorException e){