summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreconwar <conor.ward@ericsson.com>2018-08-28 09:57:05 +0000
committereconwar <conor.ward@ericsson.com>2018-08-28 09:57:05 +0000
commit2e1cf80017cafcc02824c686ea4722acbc3fd78a (patch)
tree0296b7038d80818de06abc2c1566265003c6334f
parent8a42c1bc635447ace8465d13c4e0865396e56698 (diff)
Make StatisticsTests test real methods
Change-Id: I5f3d73d78fafd3eb877029b202ea2bbbcf936dc4 Signed-off-by: Conor Ward <conor.ward@ericsson.com> Issue-ID: DMAAP-101
-rwxr-xr-xdatarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/StatisticsServletTest.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/StatisticsServletTest.java b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/StatisticsServletTest.java
index 0a9632eb..0babdc47 100755
--- a/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/StatisticsServletTest.java
+++ b/datarouter-prov/src/test/java/org/onap/dmaap/datarouter/provisioning/StatisticsServletTest.java
@@ -105,6 +105,8 @@ public class StatisticsServletTest extends DrServletTestBase {
when(response.getOutputStream()).thenReturn(outStream);
statisticsServlet = PowerMockito.mock(StatisticsServlet.class);
PowerMockito.doReturn(null).when(statisticsServlet, "getRecordsForSQL", anyString());
+ PowerMockito.doCallRealMethod().when(statisticsServlet, "buildMapFromRequest", anyObject());
+ PowerMockito.doCallRealMethod().when(statisticsServlet, "getTimeFromParam", anyString());
doNothing().when(statisticsServlet).rsToCSV(anyObject(), anyObject());
doCallRealMethod().when(statisticsServlet).doGet(request, response);
when(statisticsServlet.getFeedIdsByGroupId(anyInt())).thenReturn(new StringBuffer("1"));
@@ -116,10 +118,13 @@ public class StatisticsServletTest extends DrServletTestBase {
public void Given_Request_Is_HTTP_GET_With_GroupId_And_FeedId_Parameters_Then_Request_Succeeds()
throws Exception {
when(request.getParameter("feedid")).thenReturn("1");
+ when(request.getParameter("statusCode")).thenReturn("500");
ServletOutputStream outStream = mock(ServletOutputStream.class);
when(response.getOutputStream()).thenReturn(outStream);
statisticsServlet = PowerMockito.mock(StatisticsServlet.class);
PowerMockito.doReturn(null).when(statisticsServlet, "getRecordsForSQL", anyString());
+ PowerMockito.doCallRealMethod().when(statisticsServlet, "buildMapFromRequest", anyObject());
+ PowerMockito.doCallRealMethod().when(statisticsServlet, "getTimeFromParam", anyString());
doNothing().when(statisticsServlet).rsToCSV(anyObject(), anyObject());
doCallRealMethod().when(statisticsServlet).doGet(request, response);
doCallRealMethod().when(statisticsServlet).queryGeneretor(anyObject());