Rename a test class 23/14623/1
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Fri, 22 Sep 2017 13:43:16 +0000 (15:43 +0200)
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Fri, 22 Sep 2017 14:04:02 +0000 (16:04 +0200)
Rename a test class by using the name of the class tested

Change-Id: Ic2dc993ec874872b3acc9ef95fdfdb540ff61742
Issue-ID: CLAMP-54
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
src/test/java/org/onap/clamp/clds/client/req/OperationalPolicyReqTest.java [moved from src/test/java/org/onap/clamp/clds/client/req/SdcPolicyReqTest.java with 92% similarity]

@@ -35,7 +35,7 @@ import org.onap.policy.asdc.Resource;
 import org.onap.policy.asdc.ResourceType;
 import org.onap.policy.controlloop.policy.PolicyResult;
 
-public class SdcPolicyReqTest {
+public class OperationalPolicyReqTest {
 
     @Test
     public void convertToResourceTest() throws NoSuchMethodException, SecurityException, IllegalAccessException,
@@ -44,13 +44,12 @@ public class SdcPolicyReqTest {
                 ResourceType.class);
         method.setAccessible(true);
         // return method.invoke(targetObject, argObjects);
-        OperationalPolicyReq policyReq = new OperationalPolicyReq();
         List<String> stringList = new ArrayList<>();
         stringList.add("test1");
         stringList.add("test2");
         stringList.add("test3");
         stringList.add("test4");
-        Resource resources[] = (Resource[]) method.invoke(policyReq, stringList, ResourceType.VF);
+        Resource resources[] = (Resource[]) method.invoke(null, stringList, ResourceType.VF);
 
         assertTrue(resources.length == 4);
         assertTrue("test1".equals(resources[0].getResourceName()));
@@ -65,13 +64,12 @@ public class SdcPolicyReqTest {
         Method method = OperationalPolicyReq.class.getDeclaredMethod("convertToPolicyResult", List.class);
         method.setAccessible(true);
         // return method.invoke(targetObject, argObjects);
-        OperationalPolicyReq policyReq = new OperationalPolicyReq();
         List<String> stringList = new ArrayList<>();
         stringList.add("FAILURE");
         stringList.add("SUCCESS");
         stringList.add("FAILURE_GUARD");
         stringList.add("FAILURE_TIMEOUT");
-        PolicyResult policyResult[] = (PolicyResult[]) method.invoke(policyReq, stringList);
+        PolicyResult policyResult[] = (PolicyResult[]) method.invoke(null, stringList);
 
         assertTrue(policyResult.length == 4);
         assertTrue(policyResult[0].equals(PolicyResult.FAILURE));