JUnit additions for PAP-REST,REST,XACML
[policy/engine.git] / ONAP-REST / src / test / java / org / onap / policy / rest / adapter / ClosedLoopPolicyAdaptersTest.java
index a153efe..320c302 100644 (file)
@@ -21,6 +21,10 @@ package org.onap.policy.rest.adapter;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Modifier;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -164,4 +168,12 @@ public class ClosedLoopPolicyAdaptersTest {
                assertEquals(ClosedLoopPolicyStatus.ACTIVE.toString(), "active");
                assertEquals(ClosedLoopPolicyStatus.INACTIVE.toString(), "inactive");
        }
+       
+       @Test
+       public void testConstructorIsPrivate() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
+         Constructor<ClosedLoopPerformanceMetrics> constructor = ClosedLoopPerformanceMetrics.class.getDeclaredConstructor();
+         assertTrue(Modifier.isPrivate(constructor.getModifiers()));
+         constructor.setAccessible(true);
+         constructor.newInstance();
+       }
 }