diff options
Diffstat (limited to 'dmaap-dsa/src')
-rw-r--r-- | dmaap-dsa/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java | 3 | ||||
-rw-r--r-- | dmaap-dsa/src/test/java/org/onap/holmes/dsa/dmaappolling/SubscriberTest.java | 9 |
2 files changed, 3 insertions, 9 deletions
diff --git a/dmaap-dsa/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java b/dmaap-dsa/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java index 4845b73..d67b901 100644 --- a/dmaap-dsa/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java +++ b/dmaap-dsa/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java @@ -25,7 +25,6 @@ import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Response; import lombok.Getter; import lombok.Setter; -import org.glassfish.jersey.client.ClientConfig; import org.onap.holmes.common.api.stat.VesAlarm; import org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder; import org.onap.holmes.common.exception.CorrelationException; @@ -77,7 +76,7 @@ public class Subscriber { } private List<String> getDMaaPData() { - Client client = ClientBuilder.newClient(new ClientConfig()); + Client client = ClientBuilder.newClient(); WebTarget webTarget = client.target(url + "/" + consumerGroup + "/" + consumer); Response response = webTarget.queryParam("timeout", timeout).request().get(); return response.readEntity(List.class); diff --git a/dmaap-dsa/src/test/java/org/onap/holmes/dsa/dmaappolling/SubscriberTest.java b/dmaap-dsa/src/test/java/org/onap/holmes/dsa/dmaappolling/SubscriberTest.java index d1d3653..bc6486c 100644 --- a/dmaap-dsa/src/test/java/org/onap/holmes/dsa/dmaappolling/SubscriberTest.java +++ b/dmaap-dsa/src/test/java/org/onap/holmes/dsa/dmaappolling/SubscriberTest.java @@ -15,12 +15,8 @@ */ package org.onap.holmes.dsa.dmaappolling; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.sun.org.apache.regexp.internal.RE; -import io.dropwizard.cli.Cli; import org.easymock.EasyMock; import org.glassfish.hk2.api.ServiceLocator; -import org.glassfish.jersey.client.ClientConfig; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -133,7 +129,7 @@ public class SubscriberTest { Response response = PowerMock.createMock(Response.class); Invocation.Builder builder = PowerMock.createMock(Invocation.Builder.class); - EasyMock.expect(ClientBuilder.newClient(EasyMock.anyObject(ClientConfig.class))).andReturn(client); + EasyMock.expect(ClientBuilder.newClient()).andReturn(client); EasyMock.expect(client.target(EasyMock.anyObject(String.class))).andReturn(webTarget); EasyMock.expect(webTarget.queryParam("timeout", 15000)).andReturn(webTarget); EasyMock.expect(webTarget.request()).andReturn(builder); @@ -144,8 +140,7 @@ public class SubscriberTest { List<VesAlarm> vesAlarms = new Subscriber().subscribe(); - assertThat(new ObjectMapper().writeValueAsString(vesAlarm), - equalTo(new ObjectMapper().writeValueAsString(vesAlarms.get(0)))); + assertThat(vesAlarm, equalTo(vesAlarms.get(0))); PowerMock.verifyAll(); } |