From e3035927b9c49478e28e5ca7fca7c42c43b7300e Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 10 Feb 2021 14:23:02 -0500 Subject: More sonar issues in common Addressed the issues: - use of eq() in verify() - remove @NamedQueries - use computeIfAbsent() Issue-ID: POLICY-2914 Change-Id: I265bc98f0f326e7b4ce86c25e68fc4859bd7fb02 Signed-off-by: Jim Hahn --- .../onap/policy/common/endpoints/listeners/ScoListenerTest.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/listeners/ScoListenerTest.java') diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/listeners/ScoListenerTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/listeners/ScoListenerTest.java index 8543b73e..a782e4b2 100644 --- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/listeners/ScoListenerTest.java +++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/listeners/ScoListenerTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ package org.onap.policy.common.endpoints.listeners; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -111,14 +110,14 @@ public class ScoListenerTest { status = new MyMessage(NAME); sco = makeSco(status); primary.onTopicEvent(INFRA, TOPIC, sco); - verify(primary).onTopicEvent(eq(INFRA), eq(TOPIC), eq(sco), eq(status)); + verify(primary).onTopicEvent(INFRA, TOPIC, sco, status); assertFalse(appender.getExtracted().toString().contains("unable to decode")); // undecodable message logger.addAppender(appender); primary.onTopicEvent(INFRA, TOPIC, makeSco("[]")); - verify(primary, times(1)).onTopicEvent(eq(INFRA), eq(TOPIC), eq(sco), eq(status)); + verify(primary, times(1)).onTopicEvent(INFRA, TOPIC, sco, status); assertTrue(appender.getExtracted().toString().contains("unable to decode")); } -- cgit 1.2.3-korg