diff options
author | ramverma <ram.krishna.verma@ericsson.com> | 2018-10-05 15:36:11 +0100 |
---|---|---|
committer | ramverma <ram.krishna.verma@ericsson.com> | 2018-10-05 15:36:46 +0100 |
commit | 9cedbd41c0ee3bade89de5d2e1e822cc4e9a36e7 (patch) | |
tree | 8baab01617bb16fe85e5bfd59d2ab132089e82f3 | |
parent | e06e7f5f3b81d613fb79ced173caffc18ddf3e3d (diff) |
Fix sonar bugs in apex-pdp
Change-Id: I1ab9b9d9b0b8d1655301959d7d6b9ab3cc87eba3
Issue-ID: POLICY-954
Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
2 files changed, 8 insertions, 2 deletions
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java index 1c28388ad..1949769a6 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java @@ -89,6 +89,7 @@ public class ZooKeeperServerServiceProvider { catch (InterruptedException | IOException ie) { String message = "Zookeeper server start failed"; LOGGER.warn(message, ie); + Thread.currentThread().interrupt(); throw new ApexException(message, ie); } diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-jms/src/main/java/org/onap/policy/apex/plugins/event/carrier/jms/JmsCarrierTechnologyParameters.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-jms/src/main/java/org/onap/policy/apex/plugins/event/carrier/jms/JmsCarrierTechnologyParameters.java index d4cb2ab9a..1b2b44382 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-jms/src/main/java/org/onap/policy/apex/plugins/event/carrier/jms/JmsCarrierTechnologyParameters.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-jms/src/main/java/org/onap/policy/apex/plugins/event/carrier/jms/JmsCarrierTechnologyParameters.java @@ -20,6 +20,7 @@ package org.onap.policy.apex.plugins.event.carrier.jms; +import java.util.Base64; import java.util.Properties; import javax.naming.Context; @@ -86,7 +87,7 @@ public class JmsCarrierTechnologyParameters extends CarrierTechnologyParameters private static final String DEFAULT_INITIAL_CTXT_FACTORY = "org.jboss.naming.remote.client.InitialContextFactory"; private static final String DEFAULT_PROVIDER_URL = "remote://localhost:4447"; private static final String DEFAULT_SECURITY_PRINCIPAL = "userid"; - private static final String DEFAULT_SECURITY_CREDENTIALS = "password"; + private static final String DEFAULT_SECURITY_CREDENTIALS = "cGFzc3dvcmQ="; private static final String DEFAULT_CONSUMER_TOPIC = "apex-in"; private static final String DEFAULT_PRODUCER_TOPIC = "apex-out"; private static final int DEFAULT_CONSUMER_WAIT_TIME = 100; @@ -103,7 +104,7 @@ public class JmsCarrierTechnologyParameters extends CarrierTechnologyParameters private String initialContextFactory = DEFAULT_INITIAL_CTXT_FACTORY; private String providerUrl = DEFAULT_PROVIDER_URL; private String securityPrincipal = DEFAULT_SECURITY_PRINCIPAL; - private String securityCredentials = DEFAULT_SECURITY_CREDENTIALS; + private String securityCredentials = getDefaultCredential(); private String producerTopic = DEFAULT_PRODUCER_TOPIC; private String consumerTopic = DEFAULT_CONSUMER_TOPIC; private int consumerWaitTime = DEFAULT_CONSUMER_WAIT_TIME; @@ -382,4 +383,8 @@ public class JmsCarrierTechnologyParameters extends CarrierTechnologyParameters private boolean isNullOrBlank(final String stringValue) { return stringValue == null || stringValue.trim().length() == 0; } + + private String getDefaultCredential() { + return new String(Base64.getDecoder().decode(DEFAULT_SECURITY_CREDENTIALS.getBytes())); + } } |