From 173a07c146746f85c17f2d58f2ded84b99818f9a Mon Sep 17 00:00:00 2001 From: Sunil Unnava Date: Tue, 6 Mar 2018 11:41:18 -0500 Subject: testcases for code coverage Issue-ID: DMAAP-271 Change-Id: I9b11a61d1098598f8dc6c687a10ebf765128d977 Signed-off-by: Sunil Unnava --- .../com/att/nsa/mr/client/impl/MRConsumerImplTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/test/java/com/att/nsa/mr/client/impl/MRConsumerImplTest.java') diff --git a/src/test/java/com/att/nsa/mr/client/impl/MRConsumerImplTest.java b/src/test/java/com/att/nsa/mr/client/impl/MRConsumerImplTest.java index 86057c4..bfac947 100644 --- a/src/test/java/com/att/nsa/mr/client/impl/MRConsumerImplTest.java +++ b/src/test/java/com/att/nsa/mr/client/impl/MRConsumerImplTest.java @@ -23,11 +23,13 @@ package com.att.nsa.mr.client.impl; import java.io.IOException; import java.util.LinkedList; +import java.util.Properties; import junit.framework.TestCase; import org.junit.Test; +import com.att.nsa.mr.client.MRClientFactory; import com.att.nsa.mr.client.impl.MRConstants; import com.att.nsa.mr.client.impl.MRConsumerImpl; @@ -92,4 +94,19 @@ public class MRConsumerImplTest extends TestCase final String url = c.createUrlPath (MRConstants.makeConsumerUrl ( "localhost:8080", "topic", "cg", "cid","http" ), -1, -1 ); assertEquals ( "http://localhost:8080/events/" + "topic/cg/cid?filter=%7B+%22foo%22%3D%22bar%22bar%22+%7D", url ); } + + @Test + public void testFetchWithReturnConsumerResponse () throws IOException + { + final LinkedList hosts = new LinkedList (); + hosts.add ( "localhost:8080" ); + Properties properties = new Properties(); + properties.load(MRSimplerBatchConsumerTest.class.getClassLoader().getResourceAsStream("dme2/consumer.properties")); + + final MRConsumerImpl c = new MRConsumerImpl ( hosts, "topic", "cg", "cid", -1, -1, "{ \"foo\"=\"bar\"bar\" }", null, null ); + c.fetchWithReturnConsumerResponse(); + c.setProtocolFlag("HTTPAAF"); + c.fetchWithReturnConsumerResponse(); + assertTrue(true); + } } -- cgit 1.2.3-korg