From 59d71c593d295b2bd48a9971d89635f95759a0a2 Mon Sep 17 00:00:00 2001 From: Liam Fallon Date: Tue, 16 Jan 2018 18:42:01 +0000 Subject: Fix Sonar Technical Debt, Unit Test for APPC POJOs Mainly making fields private, fixing field and methods to follow Java guidelines, and adding getter and setter methods. Unit test added for all classes in org.onap.policy.appc Change-Id: If3db740bc146a09f8f7387f02c12b048ad00b201 Signed-off-by: Liam Fallon Issue-ID: POLICY-455 Signed-off-by: Liam Fallon --- .../java/org/onap/policy/template/demo/VCPEControlLoopTest.java | 1 - .../test/java/org/onap/policy/template/demo/VFWControlLoopTest.java | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'controlloop/templates/template.demo/src/test') diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java index 377cff465..c95d558a5 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java @@ -45,7 +45,6 @@ import org.onap.policy.controlloop.ControlLoopTargetType; import org.onap.policy.controlloop.VirtualControlLoopEvent; import org.onap.policy.controlloop.VirtualControlLoopNotification; import org.onap.policy.controlloop.policy.ControlLoopPolicy; -import org.onap.policy.controlloop.policy.TargetType; import org.onap.policy.drools.event.comm.Topic.CommInfrastructure; import org.onap.policy.drools.event.comm.TopicEndpoint; import org.onap.policy.drools.event.comm.TopicListener; diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java index 5ef20b544..95737b9c8 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java @@ -380,7 +380,7 @@ public class VFWControlLoopTest implements TopicListener { } } else if (obj instanceof Request) { - assertTrue(((Request)obj).getCommonHeader().SubRequestID.equals("1")); + assertTrue(((Request)obj).getCommonHeader().getSubRequestID().equals("1")); assertNotNull(((Request)obj).getPayload().get("generic-vnf.vnf-id")); logger.debug("\n============ APPC received the request!!! ===========\n"); @@ -390,8 +390,8 @@ public class VFWControlLoopTest implements TopicListener { * the response into the working memory */ Response appcResponse = new Response((Request)obj); - appcResponse.getStatus().Code = ResponseCode.SUCCESS.getValue(); - appcResponse.getStatus().Value = "SUCCESS"; + appcResponse.getStatus().setCode(ResponseCode.SUCCESS.getValue()); + appcResponse.getStatus().setValue("SUCCESS"); kieSession.insert(appcResponse); } } -- cgit 1.2.3-korg