2ad982910c9c7678f1b610c679218c522becd0b1
[sdc.git] / catalog-model / src / test / java / org / openecomp / sdc / be / model / OperationTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.model;
22
23 import org.junit.Test;
24 import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition;
25 import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
26 import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
27
28 public class OperationTest {
29
30         private Operation createTestSubject() {
31                 return new Operation();
32         }
33
34         @Test
35         public void testCtor() throws Exception {
36                 new Operation(new OperationDataDefinition());
37                 new Operation(new ArtifactDataDefinition(), "mock", new ListDataDefinition<>(), new ListDataDefinition<>());
38         }
39         
40         @Test
41         public void testIsDefinition() throws Exception {
42                 Operation testSubject;
43                 boolean result;
44
45                 // default test
46                 testSubject = createTestSubject();
47                 result = testSubject.isDefinition();
48         }
49
50         @Test
51         public void testSetDefinition() throws Exception {
52                 Operation testSubject;
53                 boolean definition = false;
54
55                 // default test
56                 testSubject = createTestSubject();
57                 testSubject.setDefinition(definition);
58         }
59
60         @Test
61         public void testToString() throws Exception {
62                 Operation testSubject;
63                 String result;
64
65                 // default test
66                 testSubject = createTestSubject();
67                 result = testSubject.toString();
68         }
69
70         @Test
71         public void testGetImplementationArtifact() throws Exception {
72                 Operation testSubject;
73                 ArtifactDefinition result;
74
75                 // default test
76                 testSubject = createTestSubject();
77                 result = testSubject.getImplementationArtifact();
78                 testSubject.setImplementation(new ArtifactDataDefinition());
79                 result = testSubject.getImplementationArtifact();
80         }
81 }