update appc release note
[appc.git] / appc-inbound / appc-artifact-handler / provider / src / test / java / org / onap / appc / artifact / handler / dbservices / MockSvcLogicResource.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
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
16  * 
17  *      http://www.apache.org/licenses/LICENSE-2.0
18  * 
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.
24  * 
25  * ============LICENSE_END=========================================================
26  */
27
28 package org.onap.appc.artifact.handler.dbservices;
29
30 import java.util.Map;
31
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;
35
36 public class MockSvcLogicResource extends SqlResource {
37
38     @Override
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");
48         return status;
49     }
50
51
52     @Override
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;
57     }
58 }