aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-02-10 14:23:02 -0500
committerJim Hahn <jrh3@att.com>2021-02-10 14:26:29 -0500
commite3035927b9c49478e28e5ca7fca7c42c43b7300e (patch)
tree4d06bcb63231427fbc07ed77f4c7d9f0f483440e /policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event
parent98d2ab1beb887658521d4ff42ba6b17a97f8ebae (diff)
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 <jrh3@att.com>
Diffstat (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event')
-rw-r--r--policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientTest.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientTest.java
index 3f0a002c..ffa7c5a1 100644
--- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientTest.java
+++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientTest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2020-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.
@@ -28,7 +28,6 @@ import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -103,7 +102,7 @@ public class BidirectionalTopicClientTest {
when(endpoint.getTopicSinks(SINK_TOPIC)).thenReturn(Arrays.asList(sink));
when(endpoint.getTopicSources(any())).thenReturn(Arrays.asList());
- when(endpoint.getTopicSources(eq(Arrays.asList(SOURCE_TOPIC)))).thenReturn(Arrays.asList(source));
+ when(endpoint.getTopicSources(Arrays.asList(SOURCE_TOPIC))).thenReturn(Arrays.asList(source));
client = new BidirectionalTopicClient2(SINK_TOPIC, SOURCE_TOPIC);
}
@@ -132,7 +131,7 @@ public class BidirectionalTopicClientTest {
.hasMessage("no sources for topic: unknown-source");
// too many sources
- when(endpoint.getTopicSources(eq(Arrays.asList(SOURCE_TOPIC)))).thenReturn(Arrays.asList(source, source));
+ when(endpoint.getTopicSources(Arrays.asList(SOURCE_TOPIC))).thenReturn(Arrays.asList(source, source));
assertThatThrownBy(() -> new BidirectionalTopicClient2(SINK_TOPIC, SOURCE_TOPIC))
.isInstanceOf(BidirectionalTopicClientException.class)