Change Management Schedule Optimization 37/67937/1
authorRamaPrasad Amaranarayana (ra5425) <ra5425@att.com>
Wed, 19 Sep 2018 22:42:58 +0000 (18:42 -0400)
committerRamaPrasad Amaranarayana (ra5425) <ra5425@att.com>
Wed, 19 Sep 2018 22:42:58 +0000 (18:42 -0400)
Adding CMSO Service Code for Change Management Schedule Optimization

Change-Id: I11d98eb24544bc5fda0be64d196433cf67917a7a
Issue-ID: OPTFRA-353
Signed-off-by: RamaPrasad Amaranarayana (ra5425) <ra5425@att.com>
48 files changed:
README.md [new file with mode: 0644]
cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/SchedulerTestLoopbackService.java [new file with mode: 0644]
cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/SchedulerTestLoopbackServiceImpl.java [new file with mode: 0644]
cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackService.java [new file with mode: 0644]
cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackServiceImpl.java [new file with mode: 0644]
cmso-service/src/test/java/org/onap/optf/cmso/JpaInit.java [new file with mode: 0644]
cmso-service/src/test/java/org/onap/optf/cmso/JtestHelper.java [new file with mode: 0644]
cmso-service/src/test/java/org/onap/optf/cmso/service/H2Test.java [new file with mode: 0644]
cmso-service/src/test/java/org/onap/optf/cmso/service/rs/CMSOServiceImplTest.java [new file with mode: 0644]
cmso-service/src/test/java/org/onap/optf/cmso/service/rs/MockHttpServletRequest.java [new file with mode: 0644]
cmso-service/src/test/java/org/onap/optf/cmso/utilities/PropertiesAdmin.java [new file with mode: 0644]
cmso-service/src/test/resources/application-test.properties [new file with mode: 0644]
cmso-service/src/test/resources/application.properties [new file with mode: 0644]
cmso-service/src/test/resources/data-h2.sql [new file with mode: 0644]
cmso-service/src/test/resources/schema-h2.sql [new file with mode: 0644]
cmso-service/src/test/resources/testConfig.xml [new file with mode: 0644]
cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyDomain.json.template [new file with mode: 0644]
cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyScheduleID.json.template [new file with mode: 0644]
cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyScheduleName.json.template [new file with mode: 0644]
cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyUserID.json.template [new file with mode: 0644]
cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowIncorrectPolicyId.json.template [new file with mode: 0644]
cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowIncorrectWorkflow.json.template [new file with mode: 0644]
cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNegativeNormalDurationInSeconds.json.template [new file with mode: 0644]
cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNoEndTime.json.template [new file with mode: 0644]
cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNoNodeName.json.template [new file with mode: 0644]
cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNoStartTime.json.template [new file with mode: 0644]
cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowSwitchedTime.json.template [new file with mode: 0644]
cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyAdditionalDuration.json.template [new file with mode: 0644]
cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyDomain.json.template [new file with mode: 0644]
cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyScheduleId.json.template [new file with mode: 0644]
cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyUserId.json.template [new file with mode: 0644]
cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyDomain.json.template [new file with mode: 0644]
cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyScheduleId.json.template [new file with mode: 0644]
cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyScheduleName.json.template [new file with mode: 0644]
cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptySchedulingInfo.json.template [new file with mode: 0644]
cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyUserId.json.template [new file with mode: 0644]
cmso-service/src/test/templates/changemanagement/MultipleVnfImmediate.json.template [new file with mode: 0644]
cmso-service/src/test/templates/changemanagement/OneGroupMultipleVNFsOneChangeWindow.json.template [new file with mode: 0644]
cmso-service/src/test/templates/changemanagement/OneGroupMultipleVNSsTwoChangeWindows.json.template [new file with mode: 0644]
cmso-service/src/test/templates/changemanagement/OneVnfImmediate.json.template [new file with mode: 0644]
cmso-service/src/test/templates/changemanagement/OneVnfImmediateIncorrectWorkflow.json.template [new file with mode: 0644]
cmso-service/src/test/templates/changemanagement/OneVnfImmediateReplaceVNFInfra.json.template [new file with mode: 0644]
cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindow.json.template [new file with mode: 0644]
cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindowEmptyCallbackData.json.template [new file with mode: 0644]
cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindowEmptyCallbackURL.json.template [new file with mode: 0644]
cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindowReplaceVNFInfra.json.template [new file with mode: 0644]
cmso-service/src/test/templates/changemanagement/VidCallbackData.json.template [new file with mode: 0644]
pom.xml [new file with mode: 0644]

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..b0425b6
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+# Change Management Schedule Optimization
\ No newline at end of file
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/SchedulerTestLoopbackService.java b/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/SchedulerTestLoopbackService.java
new file mode 100644 (file)
index 0000000..f75365a
--- /dev/null
@@ -0,0 +1,87 @@
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * \r
+ * Unless otherwise specified, all documentation contained herein is licensed\r
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+ * you may not use this documentation except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         https://creativecommons.org/licenses/by/4.0/\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, documentation\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+*/\r
+\r
+package org.onap.optf.cmso.test.loopback;\r
+\r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.POST;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.Produces;\r
+import javax.ws.rs.core.Context;\r
+import javax.ws.rs.core.MediaType;\r
+import javax.ws.rs.core.Response;\r
+import javax.ws.rs.core.UriInfo;\r
+import org.onap.optf.cmso.optimizer.bean.CMOptimizerRequest;\r
+import org.onap.optf.cmso.so.bean.MsoOrchestrationQueryResponse;\r
+import org.onap.optf.cmso.wf.bean.WfChangeManagementResponse;\r
+import io.swagger.annotations.Api;\r
+import io.swagger.annotations.ApiOperation;\r
+import io.swagger.annotations.ApiParam;\r
+import io.swagger.annotations.ApiResponse;\r
+import io.swagger.annotations.ApiResponses;\r
+\r
+@Api\r
+@Path("/v1/loopbacktest")\r
+@Produces({MediaType.APPLICATION_JSON})\r
+public interface SchedulerTestLoopbackService {\r
+    // ******************************************************************\r
+    @POST\r
+    @Path("/optimizer")\r
+    @Produces({MediaType.APPLICATION_JSON})\r
+    @ApiOperation(value = "", notes = "Test Optimizer connection in loopback mode.")\r
+    @ApiResponses(value = {@ApiResponse(code = 202, message = "OK"),\r
+            @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})\r
+    public Response putToOptimizer(@ApiParam(value = "SNIRO request message") CMOptimizerRequest request,\r
+            @Context UriInfo uri);\r
+\r
+    // ******************************************************************\r
+    @POST\r
+    @Path("/onap/so/infra/orchestrationRequests/v7/schedule/{vnfName}")\r
+    @Produces({MediaType.APPLICATION_JSON})\r
+    @ApiOperation(value = "", notes = "Test SO sheduling in loopback mode.",\r
+            response = WfChangeManagementResponse.class)\r
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),\r
+            @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})\r
+    public Response soScheduleLoopback(@ApiParam(value = "vnfName") @PathParam("vnfName") String vnfName,\r
+            @ApiParam(value = "SO request message") String request, @Context UriInfo uri);\r
+\r
+    // ******************************************************************\r
+    @GET\r
+    @Path("/onap/so/infra/orchestrationRequests/v7/{requestId}")\r
+    @Produces({MediaType.APPLICATION_JSON})\r
+    @ApiOperation(value = "", notes = "Test SO Status query loopback.", response = MsoOrchestrationQueryResponse.class)\r
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),\r
+            @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})\r
+    public Response soQueryLoopback(@ApiParam(value = "MSO request ID") @PathParam("requestId") String requestId,\r
+            @Context UriInfo uri);\r
+\r
+}\r
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/SchedulerTestLoopbackServiceImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/SchedulerTestLoopbackServiceImpl.java
new file mode 100644 (file)
index 0000000..b240b61
--- /dev/null
@@ -0,0 +1,215 @@
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * \r
+ * Unless otherwise specified, all documentation contained herein is licensed\r
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+ * you may not use this documentation except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         https://creativecommons.org/licenses/by/4.0/\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, documentation\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+*/\r
+\r
+package org.onap.optf.cmso.test.loopback;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+import java.util.UUID;\r
+import javax.ws.rs.ProcessingException;\r
+import javax.ws.rs.client.Client;\r
+import javax.ws.rs.client.ClientBuilder;\r
+import javax.ws.rs.client.Entity;\r
+import javax.ws.rs.client.Invocation;\r
+import javax.ws.rs.client.ResponseProcessingException;\r
+import javax.ws.rs.client.WebTarget;\r
+import javax.ws.rs.core.MediaType;\r
+import javax.ws.rs.core.Response;\r
+import javax.ws.rs.core.Response.Status;\r
+import javax.ws.rs.core.UriInfo;\r
+import org.joda.time.DateTime;\r
+import org.joda.time.format.DateTimeFormat;\r
+import org.joda.time.format.DateTimeFormatter;\r
+import org.onap.optf.cmso.common.BasicAuthenticatorFilter;\r
+import org.onap.optf.cmso.common.LogMessages;\r
+import org.onap.optf.cmso.common.PropertiesManagement;\r
+import org.onap.optf.cmso.optimizer.bean.CMOptimizerRequest;\r
+import org.onap.optf.cmso.optimizer.bean.CMOptimizerResponse;\r
+import org.onap.optf.cmso.optimizer.bean.CMRequestInfo;\r
+import org.onap.optf.cmso.optimizer.bean.CMSchedule;\r
+import org.onap.optf.cmso.optimizer.bean.CMSchedulingInfo;\r
+import org.onap.optf.cmso.optimizer.bean.CMVnfDetails;\r
+import org.onap.optf.cmso.service.rs.CMSCallbackImpl;\r
+import org.onap.optf.cmso.wf.bean.WfCmResponse200;\r
+import org.onap.optf.cmso.wf.bean.WfMsoRequestReferences;\r
+import org.onap.optf.cmso.wf.bean.WfMsoResponse;\r
+import org.springframework.beans.factory.annotation.Autowired;\r
+import org.springframework.core.env.Environment;\r
+import org.springframework.stereotype.Controller;\r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
+\r
+@Controller\r
+public class SchedulerTestLoopbackServiceImpl implements SchedulerTestLoopbackService {\r
+    private static EELFLogger log = EELFManager.getInstance().getLogger(SchedulerTestLoopbackServiceImpl.class);\r
+    private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
+    private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();\r
+\r
+    @Autowired\r
+    Environment env;\r
+\r
+    @Autowired\r
+    PropertiesManagement pm;\r
+\r
+    @Override\r
+    public Response putToOptimizer(CMOptimizerRequest request, UriInfo uri) {\r
+        //\r
+        try {\r
+            CMOptimizerResponse r = new CMOptimizerResponse();\r
+            CMRequestInfo ri = request.getRequestInfo();\r
+            CMSchedulingInfo si = request.getSchedulingInfo();\r
+            r.setTransactionId(ri.getTransactionId());\r
+            r.setRequestState("Done.");\r
+            r.setScheduleId(ri.getRequestId());\r
+            String callback = ri.getCallbackUrl();\r
+\r
+            // This is a dumb opt. WIll not make sense for multiple groups\r
+            // Use the code in the callback to help\r
+            List<String> nodes = new ArrayList<String>();\r
+            // get total number of nodes across all groups.\r
+            for (CMVnfDetails sr : si.getVnfDetails()) {\r
+                nodes.add(sr.getNode());\r
+            }\r
+\r
+            DateTime startTime = CMSCallbackImpl.convertISODate(si.getStartTime(), "startTime");\r
+\r
+            // Ignore the finish time for now in the calc. Just accept what they\r
+            // gave\r
+            DateTime finishTime = CMSCallbackImpl.convertISODate(si.getEndTime(), "endTime");\r
+            DateTimeFormatter sniroFmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss").withZoneUTC();\r
+\r
+            int add = si.getAdditionalDurationInSecs();\r
+            int normal = si.getNormalDurationInSecs();\r
+            int concurrencyLimit = si.getConcurrencyLimit();\r
+            long totalDuration = (long) add + normal;\r
+            long serialized = 0;\r
+            if (nodes.size() > concurrencyLimit) {\r
+                serialized = (nodes.size() / concurrencyLimit);\r
+                serialized = (serialized * totalDuration) * 1000;\r
+            }\r
+            DateTime latestInstanceStartTime = startTime.plus(serialized);\r
+            finishTime = latestInstanceStartTime.plus(totalDuration * 1000);\r
+            // Reformat request into a response setting the groups start finish\r
+            // time based upon\r
+            Map<String, CMSchedule> map = new HashMap<String, CMSchedule>();\r
+            for (CMVnfDetails sr : si.getVnfDetails()) {\r
+                String groupId = sr.getGroupId();\r
+                CMSchedule cms = map.get(groupId);\r
+                if (cms == null) {\r
+                    cms = new CMSchedule();\r
+                    cms.setGroupId(groupId);\r
+                    cms.setFinishTime(groupId);\r
+                    map.put(groupId, cms);\r
+                    cms.setStartTime(sniroFmt.print(startTime));\r
+                    cms.setFinishTime(sniroFmt.print(finishTime));\r
+                    cms.setLatestInstanceStartTime(sniroFmt.print(latestInstanceStartTime));\r
+                }\r
+                cms.getNode().add(sr.getNode());\r
+            }\r
+            r.setSchedule(map.values().toArray(new CMSchedule[map.values().size()]));\r
+\r
+            Thread responseThread = new Thread(new Runnable() {\r
+                public void run() {\r
+                    sendAsyncResponse(r, callback);\r
+                }\r
+            });\r
+            responseThread.start();\r
+\r
+            return Response.accepted().build();\r
+        } catch (Exception e) {\r
+            log.error("Unexpected exception", e);\r
+        }\r
+        return Response.serverError().build();\r
+    }\r
+\r
+    private void sendAsyncResponse(CMOptimizerResponse r, String url) {\r
+        try {\r
+            Client client = ClientBuilder.newClient();\r
+            String user = env.getProperty("mechid.user", "");\r
+            String pass = pm.getProperty("mechid.pass", "");\r
+            client.register(new BasicAuthenticatorFilter(user, pass));\r
+            WebTarget target = client.target(url);\r
+            Invocation.Builder invocationBuilder = target.request(MediaType.APPLICATION_JSON);\r
+            try {\r
+                Response response = invocationBuilder.post(Entity.json(r));\r
+                switch (response.getStatus()) {\r
+                    case 202:\r
+                        // Scheduled with SNIRO\r
+                        break;\r
+                    case 400: // Bad request\r
+                    case 500:\r
+                    default: {\r
+                    }\r
+                }\r
+            } catch (ResponseProcessingException e) {\r
+                errors.error(LogMessages.OPTIMIZER_EXCEPTION, e, e.getMessage());\r
+                debug.debug(LogMessages.OPTIMIZER_EXCEPTION, e, e.getMessage());\r
+\r
+            } catch (ProcessingException e) {\r
+                log.error(LogMessages.OPTIMIZER_EXCEPTION.toString(), e);\r
+                log.error(LogMessages.OPTIMIZER_EXCEPTION, e.getMessage());\r
+            }\r
+        } catch (Exception e) {\r
+            errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+            debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+\r
+        }\r
+    }\r
+\r
+    public Response soScheduleLoopback(String vnfName, String request, UriInfo uri) {\r
+        String msoRequestId = env.getProperty("loopback.mso.requestId", "4ccbfb85-1d05-442e");\r
+        String r = UUID.randomUUID().toString();\r
+        WfMsoRequestReferences rr = new WfMsoRequestReferences();\r
+        rr.setInstanceId(r);\r
+        rr.setRequestId(msoRequestId);\r
+        WfMsoResponse mso = new WfMsoResponse();\r
+        mso.setRequestReferences(rr);\r
+        WfCmResponse200 cmResponse = new WfCmResponse200();\r
+        cmResponse.setEntity(mso);\r
+        cmResponse.setStatus(202);;\r
+        return Response.status(Status.OK).entity(cmResponse).build();\r
+    }\r
+\r
+    @Override\r
+    public Response soQueryLoopback(String requestId, UriInfo uri) {\r
+        // Abbreviated response. Only interested in requestStatus....\r
+        String response = "{\"request\" : {" + "\"requestId\" : \"dummy-request-id\","\r
+                + "\"startTime\" : \"Wed, 26 Aug 2017 06:36:07 GMT\"," + "\"requestScope\" : \"vfModule\","\r
+                + "\"requestType\" : \"createInstance\"," + "\"requestDetails\" : {}," + "\"instanceReferences\" : {},"\r
+                + "\"requestStatus\" : { " + "\"requestState\" : \"COMPLETE\","\r
+                + "\"statusMessage\" : \"Vf Module has been created successfully.\"," + "\"percentProgress\" : 100,"\r
+                + "\"finishTime\" : \"Crap so cmso uses current time\"}}}";\r
+        return Response.ok().entity(response).build();\r
+    }\r
+\r
+}\r
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackService.java b/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackService.java
new file mode 100644 (file)
index 0000000..d2953b6
--- /dev/null
@@ -0,0 +1,93 @@
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * \r
+ * Unless otherwise specified, all documentation contained herein is licensed\r
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+ * you may not use this documentation except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         https://creativecommons.org/licenses/by/4.0/\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, documentation\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+*/\r
+\r
+package org.onap.optf.cmso.test.loopback;\r
+\r
+import javax.ws.rs.POST;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.Produces;\r
+import javax.ws.rs.core.Context;\r
+import javax.ws.rs.core.MediaType;\r
+import javax.ws.rs.core.Response;\r
+import javax.ws.rs.core.UriInfo;\r
+import com.fasterxml.jackson.databind.JsonNode;\r
+import io.swagger.annotations.Api;\r
+import io.swagger.annotations.ApiOperation;\r
+import io.swagger.annotations.ApiParam;\r
+import io.swagger.annotations.ApiResponse;\r
+import io.swagger.annotations.ApiResponses;\r
+\r
+@Api\r
+@Path("/v1/tm")\r
+@Produces({MediaType.APPLICATION_JSON})\r
+public interface TicketMgtLoopbackService {\r
+\r
+    // ******************************************************************\r
+    @POST\r
+    @Path("/getChangeRecord")\r
+    @Produces({MediaType.APPLICATION_JSON})\r
+    @ApiOperation(value = "", notes = "Dummy out ticket management check status call.", response = JsonNode.class)\r
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),\r
+            @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})\r
+    public Response tmGetChangeRecord(@ApiParam(value = "TM request message") JsonNode request, @Context UriInfo uri);\r
+\r
+    // ******************************************************************\r
+    @POST\r
+    @Path("/createChangeRecord")\r
+    @Produces({MediaType.APPLICATION_JSON})\r
+    @ApiOperation(value = "", notes = "Dummy out ticket management create call.", response = JsonNode.class)\r
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),\r
+            @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})\r
+    public Response tmCreateChangeRecord(@ApiParam(value = "TM request message") JsonNode request,\r
+            @Context UriInfo uri);\r
+\r
+    // ******************************************************************\r
+    @POST\r
+    @Path("/closeCancelChangeRecord")\r
+    @Produces({MediaType.APPLICATION_JSON})\r
+    @ApiOperation(value = "", notes = "Dummy out ticket management close call.", response = JsonNode.class)\r
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),\r
+            @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})\r
+    public Response tmCloseCancelChangeRecord(@ApiParam(value = "TM request message") JsonNode request,\r
+            @Context UriInfo uri);\r
+\r
+    // ******************************************************************\r
+    @POST\r
+    @Path("/updateChangeRecord")\r
+    @Produces({MediaType.APPLICATION_JSON})\r
+    @ApiOperation(value = "", notes = "Dummy out ticket management update to in progress call.",\r
+            response = JsonNode.class)\r
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),\r
+            @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})\r
+    public Response tmUpdateChangeRecord(@ApiParam(value = "TM request message") JsonNode request,\r
+            @Context UriInfo uri);\r
+\r
+}\r
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackServiceImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackServiceImpl.java
new file mode 100644 (file)
index 0000000..1c87f66
--- /dev/null
@@ -0,0 +1,93 @@
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * \r
+ * Unless otherwise specified, all documentation contained herein is licensed\r
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+ * you may not use this documentation except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         https://creativecommons.org/licenses/by/4.0/\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, documentation\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+*/\r
+\r
+package org.onap.optf.cmso.test.loopback;\r
+\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+import javax.ws.rs.core.Response;\r
+import javax.ws.rs.core.UriInfo;\r
+import org.onap.optf.cmso.common.PropertiesManagement;\r
+import org.onap.optf.cmso.ticketmgt.bean.TmApprovalStatusEnum;\r
+import org.onap.optf.cmso.ticketmgt.bean.TmChangeInfo;\r
+import org.onap.optf.cmso.ticketmgt.bean.TmStatusEnum;\r
+import org.springframework.beans.factory.annotation.Autowired;\r
+import org.springframework.core.env.Environment;\r
+import org.springframework.stereotype.Controller;\r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
+import com.fasterxml.jackson.databind.JsonNode;\r
+import com.fasterxml.jackson.databind.node.ObjectNode;\r
+\r
+@Controller\r
+public class TicketMgtLoopbackServiceImpl implements TicketMgtLoopbackService {\r
+    private static EELFLogger log = EELFManager.getInstance().getLogger(TicketMgtLoopbackServiceImpl.class);\r
+    private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
+    private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();\r
+\r
+    @Autowired\r
+    Environment env;\r
+\r
+    PropertiesManagement pm;\r
+\r
+    @Override\r
+    public Response tmGetChangeRecord(JsonNode request, UriInfo uri) {\r
+        TmChangeInfo changeInfo = new TmChangeInfo();\r
+        changeInfo.setChangeId("CHG000000000001");\r
+        changeInfo.setStatus(TmStatusEnum.Scheduled.toString());\r
+        changeInfo.setApprovalStatus(TmApprovalStatusEnum.Approved.toString());\r
+        return Response.ok().entity(changeInfo).build();\r
+    }\r
+\r
+    @Override\r
+    public Response tmCreateChangeRecord(JsonNode request, UriInfo uri) {\r
+        Map<String, String> response = new HashMap<String, String>();\r
+        response.put("changeId", "CHG000000000001");\r
+        return Response.ok().entity(response).build();\r
+    }\r
+\r
+    @Override\r
+    public Response tmCloseCancelChangeRecord(JsonNode request, UriInfo uri) {\r
+        ObjectNode req = (ObjectNode) request;\r
+        String changeId = req.get("changeId").asText();\r
+        String resp = changeId + " was update successfully.";\r
+        return Response.ok().entity(resp).build();\r
+    }\r
+\r
+    @Override\r
+    public Response tmUpdateChangeRecord(JsonNode request, UriInfo uri) {\r
+        ObjectNode req = (ObjectNode) request;\r
+        String changeId = req.get("changeId").asText();\r
+        String resp = changeId + " was updated successfully.";\r
+        return Response.ok().entity(resp).build();\r
+    }\r
+\r
+}\r
diff --git a/cmso-service/src/test/java/org/onap/optf/cmso/JpaInit.java b/cmso-service/src/test/java/org/onap/optf/cmso/JpaInit.java
new file mode 100644 (file)
index 0000000..8a3aa58
--- /dev/null
@@ -0,0 +1,57 @@
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * \r
+ * Unless otherwise specified, all documentation contained herein is licensed\r
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+ * you may not use this documentation except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         https://creativecommons.org/licenses/by/4.0/\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, documentation\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+*/\r
+\r
+package org.onap.optf.cmso;\r
+\r
+import java.util.concurrent.atomic.AtomicBoolean;\r
+import org.onap.optf.cmso.model.ApprovalType;\r
+import org.onap.optf.cmso.model.Domain;\r
+import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;\r
+\r
+public class JpaInit {\r
+\r
+    private static AtomicBoolean initialized = new AtomicBoolean(false);\r
+\r
+    public static void init(TestEntityManager entityManager) {\r
+        if (initialized.compareAndSet(true, true))\r
+            return;\r
+        Domain d = new Domain();\r
+        d.setDomain("ChangeManagement");\r
+        entityManager.persist(d);\r
+        ApprovalType at = new ApprovalType();\r
+        at.setApprovalCount(1);\r
+        at.setDomain("ChangeManagement");\r
+        at.setApprovalType("Tier 2");\r
+        entityManager.persist(at);\r
+        entityManager.flush();\r
+\r
+    }\r
+}\r
diff --git a/cmso-service/src/test/java/org/onap/optf/cmso/JtestHelper.java b/cmso-service/src/test/java/org/onap/optf/cmso/JtestHelper.java
new file mode 100644 (file)
index 0000000..d0b03e5
--- /dev/null
@@ -0,0 +1,61 @@
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * \r
+ * Unless otherwise specified, all documentation contained herein is licensed\r
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+ * you may not use this documentation except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         https://creativecommons.org/licenses/by/4.0/\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, documentation\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+*/\r
+\r
+package org.onap.optf.cmso;\r
+\r
+import java.io.File;\r
+import java.io.FileNotFoundException;\r
+import java.util.Map;\r
+import java.util.Scanner;\r
+import org.apache.commons.lang3.text.StrSubstitutor;\r
+\r
+public class JtestHelper {\r
+    private static String templatefolder = "src/test/templates" + File.separator;\r
+\r
+    public static String template(String filename, Map<String, String> values) {\r
+        String data = "";\r
+        Scanner s = null;\r
+        try {\r
+            File t = new File(templatefolder + filename);\r
+            s = new Scanner(t);\r
+            s.useDelimiter("\\Z");\r
+            data = s.next();\r
+            StrSubstitutor ss = new StrSubstitutor(values);\r
+            data = ss.replace(data);\r
+        } catch (FileNotFoundException e) {\r
+            data = "";\r
+        } finally {\r
+            if (s != null)\r
+                s.close();\r
+        }\r
+        return data;\r
+    }\r
+}\r
diff --git a/cmso-service/src/test/java/org/onap/optf/cmso/service/H2Test.java b/cmso-service/src/test/java/org/onap/optf/cmso/service/H2Test.java
new file mode 100644 (file)
index 0000000..8a586a9
--- /dev/null
@@ -0,0 +1,47 @@
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * \r
+ * Unless otherwise specified, all documentation contained herein is licensed\r
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+ * you may not use this documentation except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         https://creativecommons.org/licenses/by/4.0/\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, documentation\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+*/\r
+\r
+package org.onap.optf.cmso.service;\r
+\r
+import org.junit.Test;\r
+import org.junit.runner.RunWith;\r
+import org.springframework.test.context.ContextConfiguration;\r
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\r
+\r
+@RunWith(SpringJUnit4ClassRunner.class)\r
+@ContextConfiguration(locations = {"classpath:testConfig.xml"})\r
+public class H2Test {\r
+\r
+    @Test\r
+    public void h2Test() {\r
+\r
+    }\r
+}\r
diff --git a/cmso-service/src/test/java/org/onap/optf/cmso/service/rs/CMSOServiceImplTest.java b/cmso-service/src/test/java/org/onap/optf/cmso/service/rs/CMSOServiceImplTest.java
new file mode 100644 (file)
index 0000000..c8039ad
--- /dev/null
@@ -0,0 +1,158 @@
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * \r
+ * Unless otherwise specified, all documentation contained herein is licensed\r
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+ * you may not use this documentation except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         https://creativecommons.org/licenses/by/4.0/\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, documentation\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+*/\r
+\r
+package org.onap.optf.cmso.service.rs;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+import java.util.UUID;\r
+import javax.ws.rs.core.Response;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import org.junit.runner.RunWith;\r
+import org.onap.optf.cmso.JpaInit;\r
+import org.onap.optf.cmso.JtestHelper;\r
+import org.onap.optf.cmso.common.CMSRequestError;\r
+import org.onap.optf.cmso.service.rs.models.CMSMessage;\r
+import org.springframework.beans.factory.annotation.Autowired;\r
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;\r
+import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;\r
+import org.springframework.test.context.junit4.SpringRunner;\r
+import com.fasterxml.jackson.databind.ObjectMapper;\r
+import scala.collection.mutable.StringBuilder;\r
+\r
+@RunWith(SpringRunner.class)\r
+@DataJpaTest\r
+public class CMSOServiceImplTest {\r
+\r
+    @Autowired\r
+    CMSOServiceImpl cMSOServiceImpl;\r
+\r
+    @Autowired\r
+    private TestEntityManager entityManager;\r
+\r
+    @Before\r
+    public void setUp() throws Exception {\r
+        JpaInit.init(entityManager);\r
+    }\r
+\r
+    @Test\r
+    public void test_createScheduleRequest() {\r
+        String[] templates = {"changemanagement/MultipleVnfImmediate.json.template",};\r
+        String[] domains = {"ChangeManagement",};\r
+        String[] userIds = {"jf9860",};\r
+        String[] callbackUrls = {"http://localhost:8089/",};\r
+        String[] callbackDatum = {"sdafafadfdasfdsafdsa",};\r
+        String[] workflows = {"Replace", "Update", "NewOne",};\r
+        Integer[] normalDurationInSeeconds = {10,};\r
+        Integer[] additionalDurationInSeeconds = {10,};\r
+        String[] results = {"500:", // {additionalDurationInSeconds=10, workflow=Replace,\r
+                                    // domain=ChangeManagement,\r
+                                    // callbackData=sdafafadfdasfdsafdsa, testid=79e1,\r
+                                    // callbackUrl=http://localhost:8089/,\r
+                                    // uuid=a36b45b9-dff4-45b4-ac6b-2a4f35e179e1, userId=jf9860,\r
+                                    // normalDurationInSeconds=10}\r
+                "500:", // {additionalDurationInSeconds=10, workflow=Update,\r
+                        // domain=ChangeManagement,\r
+                        // callbackData=sdafafadfdasfdsafdsa, testid=c525,\r
+                        // callbackUrl=http://localhost:8089/,\r
+                        // uuid=26b189f7-b075-4013-b487-d938b895c525, userId=jf9860,\r
+                        // normalDurationInSeconds=10}\r
+                "500:", // {additionalDurationInSeconds=10, workflow=NewOne,\r
+                        // domain=ChangeManagement,\r
+                        // callbackData=sdafafadfdasfdsafdsa, testid=8e87,\r
+                        // callbackUrl=http://localhost:8089/,\r
+                        // uuid=4f59b14a-8040-4257-8981-defcb8f38e87, userId=jf9860,\r
+                        // normalDurationInSeconds=10}\r
+        };\r
+\r
+        int i = 0;\r
+        for (String template : templates) {\r
+            for (String domain : domains) {\r
+                for (String userId : userIds) {\r
+                    for (String callbackUrl : callbackUrls) {\r
+                        for (String callbackData : callbackDatum) {\r
+                            for (String workflow : workflows) {\r
+                                for (Integer normalDuration : normalDurationInSeeconds) {\r
+                                    for (Integer additionalDuration : additionalDurationInSeeconds) {\r
+                                        Map<String, String> values = new HashMap<String, String>();\r
+                                        String scheduleId = UUID.randomUUID().toString();\r
+                                        values.put("uuid", scheduleId);\r
+                                        values.put("testid", scheduleId.substring(scheduleId.length() - 4));\r
+                                        values.put("domain", domain);\r
+                                        values.put("userId", userId);\r
+                                        values.put("callbackUrl", callbackUrl);\r
+                                        values.put("callbackData", callbackData);\r
+                                        values.put("workflow", workflow);\r
+                                        values.put("normalDurationInSeconds", normalDuration.toString());\r
+                                        values.put("additionalDurationInSeconds", additionalDuration.toString());\r
+                                        String json = JtestHelper.template(template, values);\r
+                                        ObjectMapper om = new ObjectMapper();\r
+                                        CMSMessage scheduleMessage;\r
+                                        try {\r
+                                            scheduleMessage = om.readValue(json, CMSMessage.class);\r
+                                            MockHttpServletRequest mrequest = new MockHttpServletRequest();\r
+                                            mrequest.url.append(scheduleId);\r
+\r
+                                            Response response = cMSOServiceImpl.createScheduleRequest("v2", scheduleId,\r
+                                                    scheduleMessage, mrequest.request);\r
+\r
+                                            Object result = response.getEntity();\r
+                                            StringBuilder sb = new StringBuilder();\r
+                                            sb.append(response.getStatus()).append(":");\r
+                                            if (result instanceof CMSRequestError) {\r
+                                                String r = result.toString().replaceAll(" : Reason :.*$", "");\r
+                                                sb.append(r.replaceAll(scheduleId, "<uuid>"));\r
+                                            }\r
+                                            // Generate results[] entry\r
+                                            System.out.println("\"" + sb.toString() + "\", //" + values.toString());\r
+\r
+                                            // Debug an assertion\r
+                                            System.out.println(results[i] + ":" + sb.toString());\r
+                                            assertEquals(results[i].equals(sb.toString()), true);\r
+                                            i++;\r
+\r
+                                        } catch (Exception e) {\r
+                                            e.printStackTrace();\r
+                                        }\r
+\r
+                                    }\r
+                                }\r
+                            }\r
+\r
+                        }\r
+                    }\r
+                }\r
+            }\r
+        }\r
+    }\r
+}\r
diff --git a/cmso-service/src/test/java/org/onap/optf/cmso/service/rs/MockHttpServletRequest.java b/cmso-service/src/test/java/org/onap/optf/cmso/service/rs/MockHttpServletRequest.java
new file mode 100644 (file)
index 0000000..aace25e
--- /dev/null
@@ -0,0 +1,49 @@
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * \r
+ * Unless otherwise specified, all documentation contained herein is licensed\r
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+ * you may not use this documentation except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         https://creativecommons.org/licenses/by/4.0/\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, documentation\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+*/\r
+\r
+package org.onap.optf.cmso.service.rs;\r
+\r
+import static org.mockito.Mockito.mock;\r
+import static org.mockito.Mockito.when;\r
+import javax.servlet.http.HttpServletRequest;\r
+\r
+public class MockHttpServletRequest {\r
+    public StringBuffer url = new StringBuffer("http://localhost:8089/cmso/v1/ChangeManagement/schedules/");\r
+    public HttpServletRequest request = mock(HttpServletRequest.class);\r
+\r
+    MockHttpServletRequest() {\r
+\r
+        when(request.getRequestURL()).thenReturn(url);\r
+        when(request.getHeader("Authorization")).thenReturn("BasicbTEzODc3OnNjaGVkdWxlci1SMTgwMiE=");\r
+\r
+    }\r
+\r
+}\r
diff --git a/cmso-service/src/test/java/org/onap/optf/cmso/utilities/PropertiesAdmin.java b/cmso-service/src/test/java/org/onap/optf/cmso/utilities/PropertiesAdmin.java
new file mode 100644 (file)
index 0000000..faf408b
--- /dev/null
@@ -0,0 +1,52 @@
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * \r
+ * Unless otherwise specified, all documentation contained herein is licensed\r
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+ * you may not use this documentation except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *         https://creativecommons.org/licenses/by/4.0/\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, documentation\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+*/\r
+\r
+package org.onap.optf.cmso.utilities;\r
+\r
+import org.onap.optf.cmso.common.PropertiesManagement;\r
+\r
+public class PropertiesAdmin {\r
+    public static void main(String[] args) {\r
+        PropertiesManagement pm = new PropertiesManagement();\r
+        if (args.length < 1) {\r
+            System.out.println("Missing argument");\r
+            return;\r
+        }\r
+        String value = "";\r
+        if (args[0].startsWith("dec:")) {\r
+            value = PropertiesManagement.getDecryptedValue(args[0].substring(4));\r
+        } else {\r
+            value = pm.getEncryptedValue(args[0]);\r
+        }\r
+        System.out.println(args[0] + " : " + value);\r
+    }\r
+\r
+}\r
diff --git a/cmso-service/src/test/resources/application-test.properties b/cmso-service/src/test/resources/application-test.properties
new file mode 100644 (file)
index 0000000..e32b8db
--- /dev/null
@@ -0,0 +1,47 @@
+#-------------------------------------------------------------------------------\r
+# Copyright © 2017-2018 AT&T Intellectual Property.\r
+# Modifications Copyright © 2018 IBM.\r
+# \r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+# \r
+#         http://www.apache.org/licenses/LICENSE-2.0\r
+# \r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+# \r
+# \r
+# Unless otherwise specified, all documentation contained herein is licensed\r
+# under the Creative Commons License, Attribution 4.0 Intl. (the â??Licenseâ?\9d);\r
+# you may not use this documentation except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+# \r
+#         https://creativecommons.org/licenses/by/4.0/\r
+# \r
+# Unless required by applicable law or agreed to in writing, documentation\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+#-------------------------------------------------------------------------------\r
+\r
+info.build.artifact=@project.artifactId@\r
+info.build.name=@project.name@\r
+info.build.description=@project.description@\r
+info.build.version=@project.version@\r
+\r
+spring.jersey.type=filter\r
+\r
+logging.level.root=info\r
+logging.level.org.glassfish=info\r
+logging.level.org.glassfish.jersey=info\r
+\r
+spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration\r
+\r
+logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp}  responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex\r
+\r
+cmso.aaf.enabled=false\r
diff --git a/cmso-service/src/test/resources/application.properties b/cmso-service/src/test/resources/application.properties
new file mode 100644 (file)
index 0000000..1ddf6c8
--- /dev/null
@@ -0,0 +1,144 @@
+#-------------------------------------------------------------------------------\r
+# Copyright © 2017-2018 AT&T Intellectual Property.\r
+# Modifications Copyright © 2018 IBM.\r
+# \r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+# \r
+#         http://www.apache.org/licenses/LICENSE-2.0\r
+# \r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+# \r
+# \r
+# Unless otherwise specified, all documentation contained herein is licensed\r
+# under the Creative Commons License, Attribution 4.0 Intl. (the â??Licenseâ?\9d);\r
+# you may not use this documentation except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+# \r
+#         https://creativecommons.org/licenses/by/4.0/\r
+# \r
+# Unless required by applicable law or agreed to in writing, documentation\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+#-------------------------------------------------------------------------------\r
+\r
+info.build.artifact=@project.artifactId@\r
+info.build.name=@project.name@\r
+info.build.description=@project.description@\r
+info.build.version=@project.version@\r
+\r
+spring.jersey.type=filter\r
+\r
+logging.level.root=info\r
+logging.level.org.glassfish=info\r
+logging.level.org.glassfish.jersey=info\r
+\r
+spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration\r
+\r
+test.datasource.url=jdbc:h2:file:./h2db;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=true;MODE=MYSQL\r
+test.datasource.driver-class-name=org.h2.Driver\r
+test.datasource.username=sa\r
+test.datasource.password=sa\r
+\r
+test.datasource.initialize=false\r
+test.datasource.tomcat.max-wait=10000\r
+test.datasource.tomcat.initialSize=5\r
+test.datasource.tomcat.max-active=25\r
+test.datasource.tomcat.test-on-borrow=true\r
+\r
+test.jpa.show-sql=false\r
+test.jpa.hibernate.ddl-auto=none\r
+test.jpa.hibernate.naming.strategy=org.hibernate.cfg.EJB3NamingStrategy\r
+test.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect\r
+test.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl\r
+\r
+logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp}  responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex\r
+\r
+cmso.aaf.enabled=false\r
+\r
+# Enable swagger - Enable in development and test only\r
+cmso.swagger.enabled=true\r
+\r
+# Do not validate workflow name. Best effort will be used to create ticket\r
+# Expectation is that missing attributes will be provided in the DomainData\r
+cmso.allowUnknownWorkflowNames = true\r
+\r
+# Enable schedule immediate to be dispatched without ticket approvals\r
+# Has no effect when in vTM loopback mode as always approved.\r
+cmso.cm.dispatch.immediate.enabled = true\r
+\r
+# NUmber of seconds between sniro dispatch jobs\r
+cmso.sniro.job.interval.ms=10000\r
+\r
+# NUmber of seconds between change management cmso polling jobs\r
+# Controls frequenct of polling to the ChangeManagementScheduler table...\r
+cmso.cm.polling.job.interval.ms=10000\r
+# How many management cmso polling intervals to look ahead to dispatch\r
+# (To account for possible latency of the polling job)\r
+cmso.cm.polling.job.lookahead.intervals=5\r
+# Lead time before event time to enable dispatcher to \r
+# test that it is safe to dispatch (i.e. meeting reminder lead time)\r
+cmso.cm.dispatcher.lead.time.ms=5000\r
+# Lead time to prepare and call VID to dispatch work to MSO\r
+# Includes latency from VID call to the start of the workflow\r
+cmso.cm.dispatch.lead.time.ms=1000\r
+\r
+# sniro info \r
+cmso.sniro.maxAttempts=20\r
+#cmso.sniro.url=https://zldcmtc1njcoll01.homer.att.com:14699/sniro/api/v2/cmso\r
+#cmso.sniroCMSchedulerUsername=test1\r
+#cmso.sniroCMSchedulerPassword=enc:zZAbyhJhxJjqIrXNiXRl2g==\r
+#cmso.sniro.callbackurl=http://mtanjv9sdlg10.aic.cip.att.com:8089/cmso/v1/ChangeManagement/sniroCallback\r
+\r
+## loopback settings\r
+cmso.sniro.url=http://localhost:8089/cmso/v1/loopbacktest/sniro\r
+cmso.sniroCMSchedulerUsername=cmso@onap.org\r
+cmso.sniroCMSchedulerPassword=enc:bfodXf8qRfCqMvlxVBYNWQ==\r
+cmso.sniro.callbackurl=http://localhost:8089/cmso/v1/ChangeManagement/sniroCallback\r
+\r
+org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore\r
+\r
+vid.loopback.mso.requestId=dummy123\r
+\r
+mso.polling.interval.ms=10000\r
+#mso.user=cmso@onap.org\r
+#mso.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==\r
+\r
+## loopback settings\r
+mso.url=http://localhost:8089/cmso/v1/loopbacktest/mso\r
+mso.user=cmso@onap.org\r
+mso.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==\r
+\r
+vtm.vnfs.per.ticket=1\r
+\r
+vtm.url=http://localhost:8089/cmso/v1/loopbacktest/\r
+vtm.listPath=30673/vtm/searchChangeRecord/v1/listChangeRecords\r
+vtm.fetchQuestionnairePath=30673/vtm/searchChangeRecord/v1/getCheckListQuestionnaires\r
+vtm.createPath=31219/vtm/createChangeRecord/v1/createChangeRecord\r
+vtm.closePath=31127/vtm/manageChangeRecord/v1/closeCancelChangeRecord\r
+vtm.updatePath=31127/vtm/manageChangeRecord/v1/updateChangeRecord\r
+vtm.updateQuestionnairePath=31127/vtm/manageChangeRecord/v1/updateCheckListQuestionnaires\r
+\r
+vtm.user=cmso@onap.org\r
+vtm.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==\r
+vtm.template.folder=data/templates/vtm\r
+\r
+#### \r
+# configure the vTM ticket states that will allow a schedule to be dispatched\r
+# FOrmat:  \r
+#    <approvalStatus>|<status>,<approvalStatus>|<status>\r
+# Approval Required|Assigned is the state of a ticket when it is created by Scheduler\r
+vtm.approvalStatus=Approved|Scheduled,Approved|Assigned\r
+\r
+mechid.user=cmso@onap.org\r
+mechid.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==\r
+\r
+vid.user=cmso@onap.org\r
+vid.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==\r
diff --git a/cmso-service/src/test/resources/data-h2.sql b/cmso-service/src/test/resources/data-h2.sql
new file mode 100644 (file)
index 0000000..6c52d3b
--- /dev/null
@@ -0,0 +1,8 @@
+
+DELETE FROM DOMAINS;
+
+INSERT INTO DOMAINS (`domain`) VALUES ('ChangeManagement');
+
+DELETE FROM APPROVAL_TYPES;
+
+INSERT INTO APPROVAL_TYPES (`domain`, `approval_type`, `approval_count`) VALUES ('ChangeManagement', 'Tier 2', '1');
\ No newline at end of file
diff --git a/cmso-service/src/test/resources/schema-h2.sql b/cmso-service/src/test/resources/schema-h2.sql
new file mode 100644 (file)
index 0000000..a9e5a04
--- /dev/null
@@ -0,0 +1,233 @@
+DROP TABLE IF EXISTS CHANGE_MANAGEMENT_CHANGE_WINDOWS;
+DROP TABLE IF EXISTS DOMAIN_DATA;
+DROP TABLE IF EXISTS SCHEDULE_APPROVALS;
+DROP TABLE IF EXISTS CHANGE_MANAGEMENT_RELATED_ASSETS;
+DROP TABLE IF EXISTS CHANGE_MANAGEMENT_SCHEDULES;
+DROP TABLE IF EXISTS CHANGE_MANAGEMENT_GROUPS;
+DROP TABLE IF EXISTS SCHEDULE_EVENTS;
+DROP TABLE IF EXISTS SCHEDULES;
+DROP TABLE IF EXISTS APPROVAL_TYPES;
+DROP TABLE IF EXISTS DOMAINS;
+
+-- -----------------------------------------------------
+-- Table DOMAINS
+-- -----------------------------------------------------
+
+CREATE TABLE IF NOT EXISTS DOMAINS (
+    domain VARCHAR(256) NOT NULL,
+    CONSTRAINT PK_DOMAINS PRIMARY KEY (domain)
+)  ENGINE=INNODB;
+
+CREATE UNIQUE INDEX DOMAIN_UNIQUE ON DOMAINS (domain ASC);
+
+
+-- -----------------------------------------------------
+-- Table SCHEDULES
+-- -----------------------------------------------------
+
+CREATE TABLE IF NOT EXISTS SCHEDULES (
+    id INT NOT NULL AUTO_INCREMENT,
+    domain VARCHAR(256) NOT NULL,
+    schedule_id VARCHAR(256) NULL,
+    schedule_name VARCHAR(256) NULL,
+    user_id VARCHAR(45) NULL,
+    status VARCHAR(45) NOT NULL,
+    create_date_time BIGINT NULL,
+    schedule_info MEDIUMTEXT NOT NULL,
+    schedule MEDIUMTEXT NULL,
+    optimizer_status VARCHAR(45) NULL,
+    optimizer_message MEDIUMTEXT NULL,
+    optimizer_date_time BIGINT NULL,
+    optimizer_return_date_time BIGINT NULL,
+    optimizer_attempts_to_schedule INT NOT NULL DEFAULT 0,
+    optimizer_transaction_id VARCHAR(128) NULL,
+    delete_date_time BIGINT NULL,
+    CONSTRAINT PK_SCHEDULES PRIMARY KEY (id),
+    CONSTRAINT FK_SCHEDULES_DOMAIN FOREIGN KEY (domain)
+        REFERENCES DOMAINS (domain)
+        ON DELETE NO ACTION ON UPDATE CASCADE
+)  ENGINE=INNODB;
+CREATE UNIQUE INDEX SCHEDULE_KEY ON SCHEDULES (domain ASC, schedule_id ASC);
+
+CREATE UNIQUE INDEX OPTIMIZER_TRANSACTION_ID_UNIQUE ON SCHEDULES (optimizer_transaction_id ASC);
+
+
+-- -----------------------------------------------------
+-- Table SCHEDULE_EVENTS
+-- -----------------------------------------------------
+CREATE TABLE IF NOT EXISTS SCHEDULE_EVENTS (
+    id INT(11) NOT NULL AUTO_INCREMENT,
+    schedules_id INT(11) NOT NULL,
+    event_time BIGINT(20) NOT NULL,
+    reminder_time BIGINT(20) NOT NULL,
+    domain VARCHAR(45) NULL DEFAULT NULL,
+    event_text MEDIUMTEXT NULL DEFAULT NULL,
+    status VARCHAR(45) NULL DEFAULT NULL,
+    CONSTRAINT PK_SCHEDULE_EVENTS PRIMARY KEY (id),
+    CONSTRAINT FK_SCHEDULE_EVENTS_SCHEDULES FOREIGN KEY (schedules_id)
+        REFERENCES SCHEDULES (id)
+        ON DELETE NO ACTION ON UPDATE NO ACTION
+)  ENGINE=INNODB;
+
+CREATE INDEX FK_SCHEDULE_EVENTS_SCHEDULES_IDX ON SCHEDULE_EVENTS (schedules_id ASC);
+
+CREATE INDEX SEQ_SVENTS ON SCHEDULE_EVENTS (reminder_time ASC);
+
+
+
+-- -----------------------------------------------------
+-- Table DOMAIN_DATA
+-- -----------------------------------------------------
+
+CREATE TABLE IF NOT EXISTS DOMAIN_DATA (
+    id INT NOT NULL AUTO_INCREMENT,
+    schedules_id INT NOT NULL,
+    name VARCHAR(128) NULL,
+    value MEDIUMTEXT NULL,
+    CONSTRAINT PK_DOMAIN_DATA PRIMARY KEY (id),
+    CONSTRAINT FK_DOMAIN_DATA_SCHEDULES FOREIGN KEY (schedules_id)
+        REFERENCES SCHEDULES (id)
+        ON DELETE NO ACTION ON UPDATE NO ACTION
+)  ENGINE=INNODB;
+
+CREATE UNIQUE INDEX ID_UNIQUE ON DOMAIN_DATA (id ASC);
+
+CREATE INDEX FK_DOMAIN_DATA_SCHEDULES_IDX ON DOMAIN_DATA (schedules_id ASC);
+
+
+-- -----------------------------------------------------
+-- Table APPROVAL_TYPES
+-- -----------------------------------------------------
+
+CREATE TABLE IF NOT EXISTS APPROVAL_TYPES (
+    id INT NOT NULL AUTO_INCREMENT,
+    domain VARCHAR(256) NOT NULL,
+    approval_type VARCHAR(45) NOT NULL,
+    approval_count INT NOT NULL DEFAULT 1,
+    CONSTRAINT PK_APPROVAL_TYPES PRIMARY KEY (id),
+    CONSTRAINT FK_APPROVAL_TYPES_DOMAIN FOREIGN KEY (domain)
+        REFERENCES DOMAINS (domain)
+        ON DELETE NO ACTION ON UPDATE CASCADE
+)  ENGINE=INNODB; CREATE INDEX FK_DOMAIN_IDX ON APPROVAL_TYPES (domain ASC);
+
+
+-- -----------------------------------------------------
+-- Table SCHEDULE_APPROVALS
+-- -----------------------------------------------------
+
+CREATE TABLE IF NOT EXISTS SCHEDULE_APPROVALS (
+    id INT NOT NULL AUTO_INCREMENT,
+    schedules_id INT NOT NULL,
+    user_id VARCHAR(45) NOT NULL,
+    approval_type_id INT NOT NULL,
+    status VARCHAR(45) NOT NULL DEFAULT 'Pending Approval',
+    approval_date_time BIGINT NULL,
+    CONSTRAINT PK_SCHEDULE_APPROVALS PRIMARY KEY (id),
+    CONSTRAINT FK_SCHEDULE_APPROVALS_SCHEDULES FOREIGN KEY (schedules_id)
+        REFERENCES SCHEDULES (id)
+        ON DELETE NO ACTION ON UPDATE NO ACTION,
+    CONSTRAINT FK_SCHEDULE_APPROVALS_APPROVAL_TYPES FOREIGN KEY (approval_type_id)
+        REFERENCES APPROVAL_TYPES (id)
+        ON DELETE NO ACTION ON UPDATE NO ACTION
+)  ENGINE=INNODB;
+
+CREATE INDEX FK_SCHEDULE_APPROVALS_SCHEDULES_IDX ON SCHEDULE_APPROVALS (schedules_id ASC);
+
+CREATE INDEX FK_APPROVAL_TYPES_IDX ON SCHEDULE_APPROVALS (approval_type_id ASC);
+
+
+-- -----------------------------------------------------
+-- Table CHANGE_MANAGEMENT_GROUPS
+-- -----------------------------------------------------
+
+CREATE TABLE IF NOT EXISTS CHANGE_MANAGEMENT_GROUPS (
+    id INT NOT NULL AUTO_INCREMENT,
+    group_id VARCHAR(45) NULL,
+    schedules_id INT NULL,
+    start_time BIGINT NULL,
+    finish_time BIGINT NULL,
+    last_instance_start_time BIGINT NULL,
+    normal_duration_in_secs INT NULL,
+    additional_duration_in_secs INT NULL,
+    concurrency_limit INT NULL,
+    policy_id VARCHAR(256) NULL,
+    CONSTRAINT PK_CHANGE_MANAGEMENT_GROUPS PRIMARY KEY (id),
+    CONSTRAINT FK_CHANGE_MANAGEMENT_GROUPS_SCHEDULES FOREIGN KEY (schedules_id)
+        REFERENCES SCHEDULES (id)
+        ON DELETE NO ACTION ON UPDATE NO ACTION
+)  ENGINE=INNODB;
+
+CREATE INDEX FK_SCHEDULES_IDX ON CHANGE_MANAGEMENT_GROUPS (schedules_id ASC);
+
+CREATE UNIQUE INDEX CHANGE_MANAGEMENT_GROUP_ID_UNIQUE ON CHANGE_MANAGEMENT_GROUPS (schedules_id ASC, group_id ASC);
+
+
+-- -----------------------------------------------------
+-- Table CHANGE_MANAGEMENT_SCHEDULES
+-- -----------------------------------------------------
+
+CREATE TABLE IF NOT EXISTS CHANGE_MANAGEMENT_SCHEDULES (
+    id INT NOT NULL AUTO_INCREMENT,
+    change_management_groups_id INT NULL,
+    vnf_name VARCHAR(256) NOT NULL,
+    vnf_id VARCHAR(256) NULL,
+    status VARCHAR(45) NOT NULL,
+    start_time BIGINT NULL,
+    finish_time BIGINT NULL,
+    mso_request_id VARCHAR(45) NULL,
+    mso_status VARCHAR(45) NULL,
+    mso_message MEDIUMTEXT NULL,
+    mso_time BIGINT NULL,
+    dispatcher_instance VARCHAR(128) NULL,
+    dispatch_time BIGINT NULL,
+    execution_completed_time BIGINT NULL,
+    status_message MEDIUMTEXT NULL,
+    tm_change_id VARCHAR(15) NULL,
+    tm_approval_status VARCHAR(45) NULL,
+    tm_status VARCHAR(45) NULL,
+    CONSTRAINT PK_CHANGE_MANAGEMENT_SCHEDULES PRIMARY KEY (id),
+    CONSTRAINT FK_CHANGE_MANAGEMENT_SCHEDULES_CHANGE_MANAGEMENT_GROUP FOREIGN KEY (change_management_groups_id)
+        REFERENCES CHANGE_MANAGEMENT_GROUPS (id)
+        ON DELETE NO ACTION ON UPDATE NO ACTION
+)  ENGINE=INNODB;
+
+CREATE INDEX FK_CHANGE_MANAGEMENT_GROUP_CHANGE_MANAGEMENT_SCHEDULES_IDX ON CHANGE_MANAGEMENT_SCHEDULES (change_management_groups_id ASC);
+
+CREATE UNIQUE INDEX CHANGE_MANAGEMENT_SCHEDULES_VNF_NAME_UNIQUE ON CHANGE_MANAGEMENT_SCHEDULES (change_management_groups_id ASC, vnf_name ASC);
+
+
+-- -----------------------------------------------------
+-- Table CHANGE_MANAGEMENT_CHANGE_WINDOWS
+-- -----------------------------------------------------
+
+CREATE TABLE IF NOT EXISTS CHANGE_MANAGEMENT_CHANGE_WINDOWS (
+    id INT NOT NULL AUTO_INCREMENT,
+    change_management_groups_id INT NOT NULL,
+    start_time BIGINT NULL,
+    finish_time BIGINT NULL,
+    CONSTRAINT PK_CHANGE_MANAGEMENT_CHANGE_WINDOWS PRIMARY KEY (id),
+    CONSTRAINT FK_CHANGE_WINDOWS_CHANGE_MANAGEMENT_GROUPS1 FOREIGN KEY (change_management_groups_id)
+        REFERENCES CHANGE_MANAGEMENT_GROUPS (id)
+        ON DELETE NO ACTION ON UPDATE NO ACTION
+)  ENGINE=INNODB;
+
+CREATE INDEX FK_CHANGE_WINDOWS_CHANGE_MANAGEMENT_GROUPS1_IDX on CHANGE_MANAGEMENT_CHANGE_WINDOWS (change_management_groups_id ASC);
+
+
+-- -----------------------------------------------------
+-- Table CHANGE_MANAGEMENT_RELATED_ASSETS
+-- -----------------------------------------------------
+
+CREATE TABLE IF NOT EXISTS CHANGE_MANAGEMENT_RELATED_ASSETS (
+    id INT NOT NULL AUTO_INCREMENT,
+    change_management_schedule_id INT NULL,
+    asset_id VARCHAR(256) NULL,
+    asset_type VARCHAR(128) NULL,
+    CONSTRAINT PK_CHANGE_MANAGEMENT_RELATED_ASSETS PRIMARY KEY (id),
+    CONSTRAINT FK_CHANGE_MANAGEMENT_RELATED_ASSETS_CHANGE_MANAGEMENT_SCHEDULES FOREIGN KEY (change_management_schedule_id)
+        REFERENCES CHANGE_MANAGEMENT_SCHEDULES (id)
+        ON DELETE NO ACTION ON UPDATE NO ACTION
+)  ENGINE=INNODB;
+
+CREATE INDEX FK_CHANGE_MANAGEMENT_RELATED_ASSETS_CHANGE_MANAGEMENT_SCHED_IDX ON CHANGE_MANAGEMENT_RELATED_ASSETS (change_management_schedule_id ASC);
+
diff --git a/cmso-service/src/test/resources/testConfig.xml b/cmso-service/src/test/resources/testConfig.xml
new file mode 100644 (file)
index 0000000..b1e930c
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!--\r
+  Copyright © 2017-2018 AT&T Intellectual Property.\r
+  Modifications Copyright © 2018 IBM.\r
+  \r
+  Licensed under the Apache License, Version 2.0 (the "License");\r
+  you may not use this file except in compliance with the License.\r
+  You may obtain a copy of the License at\r
+  \r
+          http://www.apache.org/licenses/LICENSE-2.0\r
+  \r
+  Unless required by applicable law or agreed to in writing, software\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+  \r
+  \r
+  Unless otherwise specified, all documentation contained herein is licensed\r
+  under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+  you may not use this documentation except in compliance with the License.\r
+  You may obtain a copy of the License at\r
+  \r
+          https://creativecommons.org/licenses/by/4.0/\r
+  \r
+  Unless required by applicable law or agreed to in writing, documentation\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+-->\r
+\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+       xmlns:context="http://www.springframework.org/schema/context"\r
+       xmlns:jdbc="http://www.springframework.org/schema/jdbc"\r
+       xmlns:tx="http://www.springframework.org/schema/tx"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/beans \r
+               http://www.springframework.org/schema/beans/spring-beans-3.1.xsd\r
+               http://www.springframework.org/schema/context \r
+               http://www.springframework.org/schema/context/spring-context-3.1.xsd\r
+               http://www.springframework.org/schema/jdbc \r
+               http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd\r
+               http://www.springframework.org/schema/tx \r
+               http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">\r
+\r
+       <jdbc:initialize-database\r
+               data-source="test.dataSource">\r
+               <jdbc:script location="schema-h2.sql" />\r
+               <jdbc:script location="data-h2.sql" />\r
+       </jdbc:initialize-database>\r
+\r
+       <bean id="test.dataSource"\r
+               class="org.springframework.jdbc.datasource.DriverManagerDataSource"\r
+               lazy-init="false">\r
+               <property name="driverClassName" value="org.h2.Driver" />\r
+               <property name="url"\r
+                       value="jdbc:h2:file:./h2db;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=true;MODE=MYSQL;USER=sa;PASSWORD=sa" />\r
+       </bean>\r
+       \r
+       <!-- \r
+       <context:component-scan\r
+               base-package="org.onap.optf.cmso.core.model" />\r
+       <context:component-scan\r
+               base-package="org.onap.optf.cmso.core.model.dao" />\r
+       <bean id="rm.jdbcTemplate"\r
+               class="org.springframework.jdbc.core.JdbcTemplate">\r
+               <property name="dataSource" ref="test.dataSource" />\r
+       </bean>\r
+       <bean id="myEmf"\r
+               class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">\r
+               <property name="dataSource" ref="test.dataSource" />\r
+               <property name="persistenceUnitName" value="core" />\r
+               <property name="packagesToScan"\r
+                       value="org.onap.optf.cmso.core.model" />\r
+               <property name="jpaVendorAdapter">\r
+                       <bean\r
+                               class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />\r
+               </property>\r
+               <property name="jpaProperties">\r
+                       <props>\r
+                               <prop key="hibernate.hbm2ddl.auto">create-drop</prop>\r
+                               <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>\r
+                       </props>\r
+               </property>\r
+       </bean>\r
+       <bean id="transactionManager"\r
+               class="org.springframework.orm.jpa.JpaTransactionManager">\r
+               <property name="entityManagerFactory" ref="myEmf" />\r
+       </bean>\r
+       -->\r
+</beans>\r
diff --git a/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyDomain.json.template b/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyDomain.json.template
new file mode 100644 (file)
index 0000000..6187711
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO.TimeLimitAndVerticalTopology",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyScheduleID.json.template b/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyScheduleID.json.template
new file mode 100644 (file)
index 0000000..b17350a
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO.TimeLimitAndVerticalTopology",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyScheduleName.json.template b/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyScheduleName.json.template
new file mode 100644 (file)
index 0000000..c15f472
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO.TimeLimitAndVerticalTopology",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyUserID.json.template b/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowEmptyUserID.json.template
new file mode 100644 (file)
index 0000000..7b0d539
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO.TimeLimitAndVerticalTopology",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowIncorrectPolicyId.json.template b/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowIncorrectPolicyId.json.template
new file mode 100644 (file)
index 0000000..c17f7c5
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "string",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowIncorrectWorkflow.json.template b/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowIncorrectWorkflow.json.template
new file mode 100644 (file)
index 0000000..e1f9f9e
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Not A Workflow"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO.TimeLimitAndVerticalTopology",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNegativeNormalDurationInSeconds.json.template b/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNegativeNormalDurationInSeconds.json.template
new file mode 100644 (file)
index 0000000..bb36b51
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : -5,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO.TimeLimitAndVerticalTopology",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNoEndTime.json.template b/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNoEndTime.json.template
new file mode 100644 (file)
index 0000000..9a0e703
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO.TimeLimitAndVerticalTopology",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : ""
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNoNodeName.json.template b/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNoNodeName.json.template
new file mode 100644 (file)
index 0000000..22fc89a
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO.TimeLimitAndVerticalTopology",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       ""
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNoStartTime.json.template b/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowNoStartTime.json.template
new file mode 100644 (file)
index 0000000..71144c5
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO.TimeLimitAndVerticalTopology",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowSwitchedTime.json.template b/cmso-service/src/test/templates/FailureCasesChangeManagement/OneVnfOneChangeWindowSwitchedTime.json.template
new file mode 100644 (file)
index 0000000..4bb2b07
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO.TimeLimitAndVerticalTopology",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${end_time1}",
+                                               "endTime" : "${start_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyAdditionalDuration.json.template b/cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyAdditionalDuration.json.template
new file mode 100644 (file)
index 0000000..5c9e0a3
--- /dev/null
@@ -0,0 +1,23 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "VNFName1${testid}",
+                                       "VNFName2${testid}",
+                                       "VNFName3${testid}"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyDomain.json.template b/cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyDomain.json.template
new file mode 100644 (file)
index 0000000..19c1d87
--- /dev/null
@@ -0,0 +1,23 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "VNFName1${testid}",
+                                       "VNFName2${testid}",
+                                       "VNFName3${testid}"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyScheduleId.json.template b/cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyScheduleId.json.template
new file mode 100644 (file)
index 0000000..ab92d18
--- /dev/null
@@ -0,0 +1,23 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "VNFName1${testid}",
+                                       "VNFName2${testid}",
+                                       "VNFName3${testid}"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyUserId.json.template b/cmso-service/src/test/templates/MutipleVNFImmediateFailureCases/MultipleVnfImmediateEmptyUserId.json.template
new file mode 100644 (file)
index 0000000..9de749c
--- /dev/null
@@ -0,0 +1,23 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "VNFName1${testid}",
+                                       "VNFName2${testid}",
+                                       "VNFName3${testid}"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyDomain.json.template b/cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyDomain.json.template
new file mode 100644 (file)
index 0000000..c323b2c
--- /dev/null
@@ -0,0 +1,20 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "vnfDetails" : [{
+                               "node" : [
+                                       "dummy${testid}"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyScheduleId.json.template b/cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyScheduleId.json.template
new file mode 100644 (file)
index 0000000..e1b5ea3
--- /dev/null
@@ -0,0 +1,20 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "vnfDetails" : [{
+                               "node" : [
+                                       "dummy${testid}"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyScheduleName.json.template b/cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyScheduleName.json.template
new file mode 100644 (file)
index 0000000..0db2141
--- /dev/null
@@ -0,0 +1,23 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+       
+               "vnfDetails" : [{
+                               "node" : [
+                                       "dummy${testid}"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptySchedulingInfo.json.template b/cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptySchedulingInfo.json.template
new file mode 100644 (file)
index 0000000..461f166
--- /dev/null
@@ -0,0 +1,14 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+       }
+}
diff --git a/cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyUserId.json.template b/cmso-service/src/test/templates/OneVNFImmediateFailureCases/OneVnfImmediateEmptyUserId.json.template
new file mode 100644 (file)
index 0000000..a2a4ba4
--- /dev/null
@@ -0,0 +1,14 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+       }
+}
diff --git a/cmso-service/src/test/templates/changemanagement/MultipleVnfImmediate.json.template b/cmso-service/src/test/templates/changemanagement/MultipleVnfImmediate.json.template
new file mode 100644 (file)
index 0000000..632d874
--- /dev/null
@@ -0,0 +1,24 @@
+{
+       "domain" : "${domain}",
+       "scheduleId" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "${workflow}"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : ${normalDurationInSeconds},
+               "additionalDurationInSeconds" : ${additionalDurationInSeconds},
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "VNFName1${testid}",
+                                       "VNFName2${testid}",
+                                       "VNFName3${testid}"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/changemanagement/OneGroupMultipleVNFsOneChangeWindow.json.template b/cmso-service/src/test/templates/changemanagement/OneGroupMultipleVNFsOneChangeWindow.json.template
new file mode 100644 (file)
index 0000000..e08f33b
--- /dev/null
@@ -0,0 +1,32 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "${workflow}"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO_CM.TimeLimitAndVerticalTopology_pserver",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "VNFName1${testid}",
+                                       "VNFName2${testid}",
+                                       "VNFName3${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/changemanagement/OneGroupMultipleVNSsTwoChangeWindows.json.template b/cmso-service/src/test/templates/changemanagement/OneGroupMultipleVNSsTwoChangeWindows.json.template
new file mode 100644 (file)
index 0000000..64d8613
--- /dev/null
@@ -0,0 +1,37 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "${workflow}"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO_CM.TimeLimitAndVerticalTopology_pserver",
+               "vnfDetails" : [{
+                               "groupId" : "Group1",
+                               "node" : [
+                                       "VNFName1${testid}",
+                                       "VNFName2${testid}",
+                                       "VNFName3${testid}",
+                                       "VNFName4${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       },{
+                                               "startTime" : "${start_time2}",
+                                               "endTime" : "${end_time2}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
+
diff --git a/cmso-service/src/test/templates/changemanagement/OneVnfImmediate.json.template b/cmso-service/src/test/templates/changemanagement/OneVnfImmediate.json.template
new file mode 100644 (file)
index 0000000..1ca387b
--- /dev/null
@@ -0,0 +1,25 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "${workflow}",
+                       "plans" : "Run ${workflow}",
+                       "question.000000000000001" : "Yes"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "vnfDetails" : [{
+                               "groupId" : "group1",
+                               "node" : [
+                                       "dummy_node"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/changemanagement/OneVnfImmediateIncorrectWorkflow.json.template b/cmso-service/src/test/templates/changemanagement/OneVnfImmediateIncorrectWorkflow.json.template
new file mode 100644 (file)
index 0000000..ec14a91
--- /dev/null
@@ -0,0 +1,20 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Not A Workflow"
+               }
+       ],
+       "schedulingInfo" : {
+               "vnfDetails" : [{
+                               "node" : [
+                                       "dummy${testid}"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/changemanagement/OneVnfImmediateReplaceVNFInfra.json.template b/cmso-service/src/test/templates/changemanagement/OneVnfImmediateReplaceVNFInfra.json.template
new file mode 100644 (file)
index 0000000..5f8e1de
--- /dev/null
@@ -0,0 +1,22 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "ReplaceVnfInfra"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "vnfDetails" : [{
+                               "node" : [
+                                       "dummynode"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindow.json.template b/cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindow.json.template
new file mode 100644 (file)
index 0000000..e1f21d3
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "${workflow}"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO_CM.TimeLimitAndVerticalTopology_pserver",
+               "vnfDetails" : [{
+                               "groupId" : "group",
+                               "node" : [
+                                       "dlltx43gvbc"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindowEmptyCallbackData.json.template b/cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindowEmptyCallbackData.json.template
new file mode 100644 (file)
index 0000000..b6d7e72
--- /dev/null
@@ -0,0 +1,25 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "",
+                       "WorkflowName" : "Build Software Upgrade for vNFs"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO_CM.TimeLimitAndVerticalTopology_v2_split_1",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindowEmptyCallbackURL.json.template b/cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindowEmptyCallbackURL.json.template
new file mode 100644 (file)
index 0000000..92e5b4b
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Build Software Upgrade for vNFs"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO_CM.TimeLimitAndVerticalTopology_v2_split_1",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindowReplaceVNFInfra.json.template b/cmso-service/src/test/templates/changemanagement/OneVnfOneChangeWindowReplaceVNFInfra.json.template
new file mode 100644 (file)
index 0000000..3e463a8
--- /dev/null
@@ -0,0 +1,30 @@
+{
+       "domain" : "ChangeManagement",
+       "scheduleId" : "${uuid}",
+       "scheduleName" : "${uuid}",
+       "userId" : "${userId}",
+       "domainData" : [{
+                       "CallbackUrl" : "${callbackUrl}",
+                       "CallbackData" : "${callbackData}",
+                       "WorkflowName" : "Replace"
+               }
+       ],
+       "schedulingInfo" : {
+               "normalDurationInSeconds" : 100,
+               "additionalDurationInSeconds" : 10,
+               "concurrencyLimit" : 10,
+               "policyId" : "SNIRO_CM.TimeLimitAndVerticalTopology_v2_split_1",
+               "vnfDetails" : [{
+                               "groupId" : "",
+                               "node" : [
+                                       "dummy${testid}"
+                               ],
+                               "changeWindow" : [{
+                                               "startTime" : "${start_time1}",
+                                               "endTime" : "${end_time1}"
+                                       }
+                               ]
+                       }
+               ]
+       }
+}
diff --git a/cmso-service/src/test/templates/changemanagement/VidCallbackData.json.template b/cmso-service/src/test/templates/changemanagement/VidCallbackData.json.template
new file mode 100644 (file)
index 0000000..f523714
--- /dev/null
@@ -0,0 +1,40 @@
+{
+       "requestType" : "Update",
+       "requestDetails" : [{
+                       "vnfName" : "dummynode",
+                       "vnfInstanceId" : "dummy-vnf-id",
+                       "modelInfo" : {
+                               "modelType" : "vnf",
+                               "modelInvariantId" : "dummy-model-id",
+                               "modelVersionId" : "dummy-model-version-id",
+                               "modelName" : "dummy-model-name",
+                               "modelCustomizationId" : "dummy-model-cust-id"
+                       },
+                       "cloudConfiguration" : {
+                               "lcpCloudRegionId" : "dummy-region-id",
+                               "tenantId" : "dummy-tenent-id"
+                       },
+                       "requestInfo" : {
+                               "source" : "VID",
+                               "suppressRollback" : false,
+                               "requestorId" : "onap"
+                       },
+                       "relatedInstanceList" : [{
+                                       "relatedInstance" : {
+                                               "instanceId" : "dummy-instance-id",
+                                               "modelInfo" : {
+                                                       "modelType" : "service",
+                                                       "modelInvariantId" : "dummy-model-id",
+                                                       "modelVersionId" : "dummy-model-version-id",
+                                                       "modelName" : "dummy-model-name",
+                                                       "modelVersion" : "4.0"
+                                               }
+                                       }
+                               }
+                       ],
+                       "requestParameters" : {
+                               "usePreload" : true
+                       }
+               }
+       ]
+}
diff --git a/pom.xml b/pom.xml
new file mode 100644 (file)
index 0000000..f789f41
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+  Copyright © 2017-2018 AT&T Intellectual Property.\r
+  Modifications Copyright © 2018 IBM.\r
+  \r
+  Licensed under the Apache License, Version 2.0 (the "License");\r
+  you may not use this file except in compliance with the License.\r
+  You may obtain a copy of the License at\r
+  \r
+          http://www.apache.org/licenses/LICENSE-2.0\r
+  \r
+  Unless required by applicable law or agreed to in writing, software\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+  \r
+  \r
+  Unless otherwise specified, all documentation contained herein is licensed\r
+  under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
+  you may not use this documentation except in compliance with the License.\r
+  You may obtain a copy of the License at\r
+  \r
+          https://creativecommons.org/licenses/by/4.0/\r
+  \r
+  Unless required by applicable law or agreed to in writing, documentation\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+-->\r
+\r
+<project xmlns="http://maven.apache.org/POM/4.0.0"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+       <modelVersion>4.0.0</modelVersion>\r
+\r
+       <groupId>org.onap.optf.cmso</groupId>\r
+       <artifactId>cmso</artifactId>\r
+       <version>0.1.0-SNAPSHOT</version>\r
+       <packaging>pom</packaging>\r
+       \r
+       <name>optf-cmso</name>\r
+    <url>https://wiki.onap.org</url>\r
+\r
+    <issueManagement>\r
+        <system>JIRA</system>\r
+        <url>https://jira.onap.org/</url>\r
+    </issueManagement>\r
+\r
+    <scm>\r
+        <connection>scm:git:ssh://git@${onap.git.host}/ccsdk/sli/adaptors</connection>\r
+        <developerConnection>scm:git:ssh://${onap.git.host}:${onap.git.port}/optf/cmso</developerConnection>\r
+        <url>${onap.git.protocol}://${onap.git.host}/optf/cmso</url>\r
+        <tag>optf-cmso-${project.version}</tag>\r
+    </scm>\r
+    \r
+    <modules>\r
+        <module>cmso-service</module>\r
+        <module>cmso-database</module>\r
+    </modules>\r
+\r
+</project>\r