Unit test coverage
[appc.git] / appc-sdc-listener / appc-sdc-listener-bundle / src / test / java / org / onap / appc / sdc / artifacts / object / SDCReferenceTest.java
1 /*
2 * ============LICENSE_START=======================================================
3 * ONAP : APPC
4 * ================================================================================
5 * Copyright 2018 TechMahindra
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 package org.onap.appc.sdc.artifacts.object;
21
22 import static org.junit.Assert.assertNotEquals;
23 import static org.junit.Assert.assertTrue;
24
25 import org.junit.Assert;
26 import org.junit.Before;
27 import org.junit.Test;
28
29 public class SDCReferenceTest {
30     private SDCReference sDCReference;
31     
32     @Before
33     public void setUp() {
34         sDCReference = new SDCReference();
35     }
36     @Test
37     public void testGetVnfType() {
38         sDCReference.setVnfType("vnfType");
39         Assert.assertNotNull(sDCReference.getVnfType());
40         Assert.assertEquals("vnfType", sDCReference.getVnfType());
41     }
42
43     @Test
44     public void testGetVnfcType() {
45         sDCReference.setVnfcType("vnfcType");
46         Assert.assertNotNull(sDCReference.getVnfcType());
47         Assert.assertEquals("vnfcType", sDCReference.getVnfcType());
48     }
49     
50     @Test
51     public void testGetFileCategory() {
52         sDCReference.setFileCategory("fileCategory");
53         Assert.assertNotNull(sDCReference.getFileCategory());
54         Assert.assertEquals("fileCategory", sDCReference.getFileCategory());
55     }
56     
57     @Test
58     public void testGetAction() {
59         sDCReference.setAction("action");
60         Assert.assertNotNull(sDCReference.getAction());
61         Assert.assertEquals("action", sDCReference.getAction());
62     }
63     
64     @Test
65     public void testGetArtifactType() {
66         sDCReference.setArtifactType("artifactType");
67         Assert.assertNotNull(sDCReference.getArtifactType());
68         Assert.assertEquals("artifactType", sDCReference.getArtifactType());
69     }
70     
71     @Test
72     public void testGetArtifactName() {
73         sDCReference.setArtifactName("artifactName");
74         Assert.assertNotNull(sDCReference.getArtifactName());
75         Assert.assertEquals("artifactName", sDCReference.getArtifactName());
76     }
77     
78     @Test
79     public void testToString_ReturnNonEmptyString() {
80         assertNotEquals(sDCReference.toString(), "");
81         assertNotEquals(sDCReference.toString(), null);
82     }
83
84     @Test
85     public void testToString_ContainsString() {
86         assertTrue(sDCReference.toString().contains("vnfType"));
87     }
88 }