aboutsummaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main
diff options
context:
space:
mode:
authorJoss Armstrong <joss.armstrong@ericsson.com>2019-02-12 15:21:50 +0000
committerTakamune Cho <takamune.cho@att.com>2019-02-12 21:31:49 +0000
commit5cdae4bc7e38c832028cff161979a17e25d0af80 (patch)
tree89c2ec1afbff36ac85e5dd56d0e52c4dcc4ffe1b /appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main
parent80af84927200d30a9c0deb923a24c757db0b8b83 (diff)
Test Coverage in DmaapConsumerImpl
Increased coverage Issue-ID: APPC-1415 Change-Id: I29e2d0883914aeec652a47436c86c6ea8e5ab7a5 Signed-off-by: Joss Armstrong <joss.armstrong@ericsson.com>
Diffstat (limited to 'appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main')
-rw-r--r--appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapConsumerImpl.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapConsumerImpl.java b/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapConsumerImpl.java
index 686bb071f..30455201e 100644
--- a/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapConsumerImpl.java
+++ b/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapConsumerImpl.java
@@ -8,6 +8,8 @@
* ================================================================================
* Modifications Copyright (C) 2018 IBM
* ================================================================================
+ * Modifications Copyright (C) 2019 Ericsson
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -53,7 +55,7 @@ import org.osgi.framework.ServiceReference;
public class DmaapConsumerImpl implements Consumer {
private static final EELFLogger LOG = EELFManager.getInstance().getLogger(DmaapConsumerImpl.class);
- private final Configuration configuration = ConfigurationFactory.getConfiguration();
+ private Configuration configuration = ConfigurationFactory.getConfiguration();
// Default values
private static final int DEFAULT_TIMEOUT_MS = 60000;
private static final int DEFAULT_LIMIT = 1000;
@@ -93,7 +95,7 @@ public class DmaapConsumerImpl implements Consumer {
private void initMetric() {
LOG.debug("Metric getting initialized");
- MetricService metricService = getMetricservice();
+ MetricService metricService = getMetricService();
if (metricService != null) {
metricRegistry = metricService.createRegistry("APPC");
@@ -108,7 +110,10 @@ public class DmaapConsumerImpl implements Consumer {
logPublishers[0] = logPublisher;
PublishingPolicy manuallyScheduledPublishingPolicy = metricRegistry.policyBuilderFactory()
- .scheduledPolicyBuilder().withPublishers(logPublishers).withMetrics(metrics).build();
+ .scheduledPolicyBuilder()
+ .withPublishers(logPublishers)
+ .withMetrics(metrics)
+ .build();
LOG.debug("Policy getting initialized");
manuallyScheduledPublishingPolicy.init();
@@ -215,7 +220,7 @@ public class DmaapConsumerImpl implements Consumer {
useHttps = yes;
}
- private MetricService getMetricservice() {
+ protected MetricService getMetricService() {
BundleContext bctx = FrameworkUtil.getBundle(MetricService.class).getBundleContext();
ServiceReference sref = bctx.getServiceReference(MetricService.class.getName());
if (sref != null) {