From a2d41239cd468bd2894336353b31007dfe99bf81 Mon Sep 17 00:00:00 2001 From: GuangrongFu Date: Mon, 19 Jul 2021 19:09:39 +0800 Subject: Updated holmes-actions to 1.3.5 Change-Id: I7c24569f762233f3bbe0805dc6d6b280a6105c0f Issue-ID: HOLMES-461 Signed-off-by: GuangrongFu --- .../src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java | 6 +++--- .../test/java/org/onap/holmes/dsa/dmaappolling/SubscriberTest.java | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'engine-d') diff --git a/engine-d/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java b/engine-d/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java index 2c9d88b..8c3d4f5 100644 --- a/engine-d/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java +++ b/engine-d/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java @@ -77,15 +77,15 @@ public class Subscriber { } } - private List getDMaaPData() throws Exception { - return new JerseyClient() + private List getDMaaPData() { + return JerseyClient.newInstance() .path(consumerGroup) .path(consumer) .queryParam("timeout", period) .get(url, List.class); } - private List extractVesAlarm(List responseEntity) throws IOException { + private List extractVesAlarm(List responseEntity) { List vesAlarmList = new ArrayList<>(); for (String entity : responseEntity) { vesAlarmList.add(dMaaPResponseUtil.convertJsonToVesAlarm(entity)); diff --git a/engine-d/src/test/java/org/onap/holmes/dsa/dmaappolling/SubscriberTest.java b/engine-d/src/test/java/org/onap/holmes/dsa/dmaappolling/SubscriberTest.java index 4cf1caf..f88ddfb 100644 --- a/engine-d/src/test/java/org/onap/holmes/dsa/dmaappolling/SubscriberTest.java +++ b/engine-d/src/test/java/org/onap/holmes/dsa/dmaappolling/SubscriberTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 ZTE Corporation. + * Copyright 2017-2021 ZTE Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.assertThat; @RunWith(PowerMockRunner.class) -@PrepareForTest({ServiceLocatorHolder.class, ServiceLocator.class, Subscriber.class}) +@PrepareForTest({ServiceLocatorHolder.class, JerseyClient.class}) @PowerMockIgnore("javax.net.ssl.*") public class SubscriberTest { @@ -220,7 +220,8 @@ public class SubscriberTest { subscriber.setUrl("https://www.onap.org"); subscriber.setConsumerGroup("group"); subscriber.setConsumer("consumer"); - List vesAlarms = subscriber.subscribe(); + + subscriber.subscribe(); PowerMock.verifyAll(); } -- cgit 1.2.3-korg