From 72cf248dced4e272e69a8c48f5ee24c9d345f41d Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 25 Aug 2020 17:05:37 -0400 Subject: Address more sonars in drools-pdp Addressed the following sonars: - either log or rethrow - call "remove()" for thread-local-storage - use assertEquals - only one method call in exception test - swap arguments in assertEquals - add assertion to assertThatThrownBy() - explain @Ignore Also addressed eclipse warnings: - unused fields and methods Issue-ID: POLICY-2616 Change-Id: I6590c0d2b103885bc933014d48bf5fd92401cd80 Signed-off-by: Jim Hahn --- .../policy/drools/lifecycle/LifecycleStateUnsupportedTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'feature-lifecycle') diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java index 1b7c62a3..400aa169 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java @@ -90,19 +90,22 @@ public abstract class LifecycleStateUnsupportedTest { @Test public void update() { - assertThatThrownBy(() -> state.update(new PdpUpdate())) + PdpUpdate update = new PdpUpdate(); + assertThatThrownBy(() -> state.update(update)) .isInstanceOf(UnsupportedOperationException.class); } @Test public void stateChange() { - assertThatThrownBy(() -> state.stateChange(new PdpStateChange())) + PdpStateChange change = new PdpStateChange(); + assertThatThrownBy(() -> state.stateChange(change)) .isInstanceOf(UnsupportedOperationException.class); } @Test public void changeState() { - assertThatThrownBy(() -> state.transitionToState(new LifecycleStateActive(new LifecycleFsm()))) + LifecycleStateActive active = new LifecycleStateActive(new LifecycleFsm()); + assertThatThrownBy(() -> state.transitionToState(active)) .isInstanceOf(UnsupportedOperationException.class); } } -- cgit 1.2.3-korg