Added new files requied for operation
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / components / InterfaceOperationTestUtils.java
1 /*
2  * Copyright © 2016-2018 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.openecomp.sdc.be.components;
18
19 import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
20 import org.openecomp.sdc.be.datatypes.elements.OperationInputDefinition;
21 import org.openecomp.sdc.be.model.ArtifactDefinition;
22 import org.openecomp.sdc.be.model.InterfaceDefinition;
23 import org.openecomp.sdc.be.model.Operation;
24
25 import java.util.Map;
26
27 public interface InterfaceOperationTestUtils {
28
29     default InterfaceDefinition createInterface(String uniqueID, String description, String type,
30                                                 String toscaResourceName, Map<String, Operation> op) {
31         InterfaceDefinition id = new InterfaceDefinition();
32         id.setType(type);
33         id.setDescription(description);
34         id.setUniqueId(uniqueID);
35         id.setToscaResourceName(toscaResourceName);
36         id.setOperationsMap(op);
37         return id;
38     }
39
40
41     default Operation createInterfaceOperation(String uniqueID, String description, ArtifactDefinition artifactDefinition,
42                                                ListDataDefinition<OperationInputDefinition> inputs, String name) {
43         Operation operation = new Operation();
44
45         operation.setUniqueId(uniqueID);
46         operation.setDescription(description);
47         operation.setImplementation(artifactDefinition);
48         operation.setInputs(inputs);
49         operation.setName(name);
50
51         return operation;
52     }
53
54
55 }