Improve SONAR coverage
[vid.git] / vid-app-common / src / test / java / org / openecomp / vid / model / ModelUtilTest.java
1 package org.openecomp.vid.model;
2
3 import org.junit.Assert;
4 import org.junit.Test;
5
6
7 public class ModelUtilTest {
8
9         private ModelUtil createTestSubject() {
10                 return new ModelUtil();
11         }
12
13         
14         @Test
15         public void testGetTags() throws Exception {
16                 String[] namespaces;
17                 String constantValue = "test";
18                 String[] result;
19
20                 // test 1
21                 namespaces = null;
22                 result = ModelUtil.getTags(namespaces, constantValue);
23                 Assert.assertNull(result);
24
25                 // test 2
26                 namespaces = new String[] { "" };
27                 result = ModelUtil.getTags(namespaces, constantValue);
28                 Assert.assertArrayEquals(new String[] { constantValue }, result);
29         }
30
31         
32         @Test
33         public void testIsType() throws Exception {
34                 String type = "a";
35                 String[] tags;
36                 boolean result;
37
38                 // test 1
39                 tags = null;
40                 result = ModelUtil.isType(type, tags);
41                 Assert.assertEquals(false, result);
42
43                 // test 2
44                 tags = new String[] { "a" };
45                 result = ModelUtil.isType(type, tags);
46                 Assert.assertEquals(true, result);
47         }
48 }