2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 * ============LICENSE_END=========================================================
25 package org.openecomp.appc.artifact.handler.node;
27 import org.json.JSONObject;
28 import org.openecomp.appc.artifact.handler.dbservices.MockDBService;
29 import org.openecomp.appc.artifact.handler.utils.SdcArtifactHandlerConstants;
30 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
32 public class MockArtifactHandlerNode extends ArtifactHandlerNode {
35 public boolean updateStoreArtifacts(JSONObject request_information, JSONObject document_information)
37 if (request_information != null && request_information.get("RequestInfo").equals("testupdateStoreArtifacts")) {
38 super.updateStoreArtifacts(request_information, document_information);
40 SvcLogicContext context = new SvcLogicContext();
41 MockDBService dbservice = MockDBService.initialise();
43 context.setAttribute("artifact_name",
44 document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_NAME));
45 String internal_version = dbservice.getInternalVersionNumber(context,
46 document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_NAME), null);
47 if (internal_version != null) {
48 intversion = Integer.parseInt(internal_version);
57 public boolean storeReferenceData(JSONObject request_information, JSONObject document_information)
59 if (request_information != null && request_information.get("RequestInfo").equals("testStoreReferenceData")) {
60 super.storeReferenceData(request_information, document_information);