aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisherTest.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-06-24 15:46:36 -0400
committerJim Hahn <jrh3@att.com>2019-06-26 08:55:15 -0400
commit67fcc6f6abb7904ecd4b4444fa23b355cf9fd4ae (patch)
treef5c63d96a4d337e8210f4d83c3dd14caf8e1c051 /policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisherTest.java
parentd1ab0ec8471deeb7739206dc2ef0aac3dc5b245f (diff)
Fix some sonar issues in policy-endpoints
Refactored various classes to reduce cyclomatic complexity. Introduced some endpoint utility classes to facilitate extraction and conversion of property values, and populating of common "builder" values. Change-Id: Ie1c91cd94cb54700dc9127f72780b4d94b82ec39 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisherTest.java')
-rw-r--r--policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisherTest.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisherTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisherTest.java
index 283d44da..1d02a9d2 100644
--- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisherTest.java
+++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisherTest.java
@@ -107,35 +107,35 @@ public class BusPublisherTest extends TopicTestBase {
@Test
public void testDmaapPublisherWrapper() {
// verify with different constructor arguments
- new DmaapAafPublisherWrapper(servers, MY_TOPIC, MY_USERNAME, MY_PASSWD, true);
- new DmaapAafPublisherWrapper(servers, MY_TOPIC, MY_USERNAME, MY_PASSWD, false);
- new DmaapPublisherWrapper(ProtocolTypeConstants.DME2, servers, MY_TOPIC, MY_USERNAME, MY_PASSWD, true) {};
+ new DmaapAafPublisherWrapper(servers, MY_TOPIC, MY_USERNAME, MY_PASS, true);
+ new DmaapAafPublisherWrapper(servers, MY_TOPIC, MY_USERNAME, MY_PASS, false);
+ new DmaapPublisherWrapper(ProtocolTypeConstants.DME2, servers, MY_TOPIC, MY_USERNAME, MY_PASS, true) {};
}
@Test(expected = IllegalArgumentException.class)
public void testDmaapPublisherWrapper_InvalidTopic() {
- new DmaapPublisherWrapper(ProtocolTypeConstants.DME2, servers, "", MY_USERNAME, MY_PASSWD, true) {};
+ new DmaapPublisherWrapper(ProtocolTypeConstants.DME2, servers, "", MY_USERNAME, MY_PASS, true) {};
}
@Test(expected = IllegalArgumentException.class)
public void testDmaapPublisherWrapper_Aaf_NullServers() {
- new DmaapAafPublisherWrapper(null, MY_TOPIC, MY_USERNAME, MY_PASSWD, true);
+ new DmaapAafPublisherWrapper(null, MY_TOPIC, MY_USERNAME, MY_PASS, true);
}
@Test(expected = IllegalArgumentException.class)
public void testDmaapPublisherWrapper_Aaf_NoServers() {
- new DmaapAafPublisherWrapper(Collections.emptyList(), MY_TOPIC, MY_USERNAME, MY_PASSWD, true);
+ new DmaapAafPublisherWrapper(Collections.emptyList(), MY_TOPIC, MY_USERNAME, MY_PASS, true);
}
@Test(expected = IllegalArgumentException.class)
public void testDmaapPublisherWrapper_InvalidProtocol() {
- new DmaapPublisherWrapper(ProtocolTypeConstants.HTTPNOAUTH, servers, MY_TOPIC, MY_USERNAME, MY_PASSWD, true) {};
+ new DmaapPublisherWrapper(ProtocolTypeConstants.HTTPNOAUTH, servers, MY_TOPIC, MY_USERNAME, MY_PASS, true) {};
}
@Test
public void testDmaapPublisherWrapperClose() throws Exception {
MRSimplerBatchPublisher pub = mock(MRSimplerBatchPublisher.class);
- DmaapPublisherWrapper dmaap = new DmaapAafPublisherWrapper(servers, MY_TOPIC, MY_USERNAME, MY_PASSWD, true);
+ DmaapPublisherWrapper dmaap = new DmaapAafPublisherWrapper(servers, MY_TOPIC, MY_USERNAME, MY_PASS, true);
dmaap.publisher = pub;
dmaap.close();
@@ -149,7 +149,7 @@ public class BusPublisherTest extends TopicTestBase {
@Test
public void testDmaapPublisherWrapperSend() {
MRSimplerBatchPublisher pub = mock(MRSimplerBatchPublisher.class);
- DmaapPublisherWrapper dmaap = new DmaapAafPublisherWrapper(servers, MY_TOPIC, MY_USERNAME, MY_PASSWD, true);
+ DmaapPublisherWrapper dmaap = new DmaapAafPublisherWrapper(servers, MY_TOPIC, MY_USERNAME, MY_PASS, true);
dmaap.publisher = pub;
// null response
@@ -171,7 +171,7 @@ public class BusPublisherTest extends TopicTestBase {
@Test(expected = IllegalArgumentException.class)
public void testDmaapPublisherWrapperSend_NullMessage() {
MRSimplerBatchPublisher pub = mock(MRSimplerBatchPublisher.class);
- DmaapPublisherWrapper dmaap = new DmaapAafPublisherWrapper(servers, MY_TOPIC, MY_USERNAME, MY_PASSWD, true);
+ DmaapPublisherWrapper dmaap = new DmaapAafPublisherWrapper(servers, MY_TOPIC, MY_USERNAME, MY_PASS, true);
dmaap.publisher = pub;
dmaap.send(MY_PARTITION, null);