Merge "Reorder modifiers"
[so.git] / bpmn / MSOCoreBPMN / src / test / java / org / openecomp / mso / bpmn / core / domain / LicenseTest.java
1 /*\r
2 * ============LICENSE_START=======================================================\r
3 * ONAP : SO\r
4 * ================================================================================\r
5 * Copyright 2018 TechMahindra\r
6 *=================================================================================\r
7 * Licensed under the Apache License, Version 2.0 (the "License");\r
8 * you may not use this file except in compliance with the License.\r
9 * You may obtain a copy of the License at\r
10 *\r
11 *     http://www.apache.org/licenses/LICENSE-2.0\r
12 *\r
13 * Unless required by applicable law or agreed to in writing, software\r
14 * distributed under the License is distributed on an "AS IS" BASIS,\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16 * See the License for the specific language governing permissions and\r
17 * limitations under the License.\r
18 * ============LICENSE_END=========================================================\r
19 */\r
20 package org.openecomp.mso.bpmn.core.domain;\r
21 \r
22 \r
23 import static org.junit.Assert.assertArrayEquals;\r
24 import static org.junit.Assert.assertEquals;\r
25 \r
26 import java.util.ArrayList;\r
27 import java.util.List;\r
28 \r
29 import org.junit.Before;\r
30 import org.junit.Test;\r
31 import org.junit.runner.RunWith;\r
32 import org.mockito.BDDMockito.Then;\r
33 import org.mockito.InjectMocks;\r
34 import org.mockito.Mock;\r
35 import org.powermock.api.mockito.PowerMockito;\r
36 import org.powermock.core.classloader.annotations.PrepareForTest;\r
37 import org.powermock.modules.junit4.PowerMockRunner;\r
38 \r
39 \r
40 //@RunWith(PowerMockRunner.class)\r
41 //@PrepareForTest({License.class})\r
42 public class LicenseTest {\r
43         \r
44         //@Mock\r
45         private License license= new License();\r
46         //@InjectMocks\r
47         //private LicenseTest licenceTest;\r
48         List<String> entitlementPoolList = new ArrayList<String>();\r
49         private List<String> licenseKeyGroupList = new ArrayList<String>();\r
50         //JSONArray array = new JSONArray(entitlementPoolList);\r
51         //JSONArray array1 = new JSONArray(licenseKeyGroupList);\r
52         //@PrepareForTest({License.class})\r
53         Long serialVersionUID = 333L;\r
54         \r
55         @Test\r
56         public void testLicense() {\r
57                 license.setEntitlementPoolList(entitlementPoolList);\r
58                 license.setLicenseKeyGroupList(licenseKeyGroupList);\r
59                 //license.addEntitlementPool("entitlementPoolUuid");\r
60                 license.addLicenseKeyGroup("licenseKeyGroupUuid");\r
61                 assertEquals(license.getEntitlementPoolList(), entitlementPoolList);\r
62                 assertEquals(license.getLicenseKeyGroupList(), licenseKeyGroupList);\r
63                 assert(license.getEntitlementPoolListAsString()!= null);\r
64                 assert(license.getLicenseKeyGroupListAsString()!=null);\r
65                 license.addEntitlementPool("entitlementPoolUuid");\r
66                 //assertEquals(license.getSerialversionuid(), serialVersionUID);\r
67                 //assertArrayEquals(license.getSerialversionuid(), serialVersionUID);\r
68                 //assert\r
69         \r
70                 /*PowerMockito.mockStatic(License.class);\r
71                 Mockito.when(License.getSerialversionuid()).thenReturn(getserial());\r
72                 assertEquals(License.getSerialversionuid(),"abc");*/\r
73                 \r
74         }\r
75         // @Before \r
76         // public void mocksetUp() {\r
77 //      Long serialVersionUID = 333L;\r
78 //            PowerMockito.mockStatic(License.class);\r
79 //            expect (license.getSerialversionuid()).andReturn(serialVersionUID);\r
80 //            //PowerMockito.when(license.getSerialversionuid().\r
81 //            //PowerMockito.when(MathUtil.addInteger(2, 2)).thenReturn(1);\r
82 //         }\r
83         \r
84         /*private Long getserial() {\r
85                 \r
86                 return abc;\r
87         }*/\r
88 \r
89 }\r