2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Modifications Copyright (C) 2018 IBM
10 * ================================================================================
11 * Modifications Copyright (C) 2019 Ericsson
12 * ================================================================================
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
17 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
25 * ============LICENSE_END=========================================================
28 package org.onap.appc.artifact.handler.dbservices;
32 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
33 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
34 import org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource;
36 public class MockSvcLogicResource extends SqlResource {
39 public QueryStatus query(String resource, boolean localOnly, String select, String key, String prefix,
40 String orderBy, SvcLogicContext ctx) throws SvcLogicException {
41 QueryStatus status = QueryStatus.SUCCESS;
42 ctx.setAttribute("keys",key);
43 ctx.setAttribute("id", "testId");
44 ctx.setAttribute("VNF_TYPE", "testvnf");
45 ctx.setAttribute("maximum", "1");
46 ctx.setAttribute("COUNT(*)", "1");
47 ctx.setAttribute("download-config-dg", "TestDG");
53 public QueryStatus save(String resource, boolean force, boolean localOnly, String key, Map<String, String> parms,
54 String prefix, SvcLogicContext ctx) throws SvcLogicException {
55 ctx.setAttribute("keys", key);
56 return QueryStatus.SUCCESS;