From 40a17c1d7e5f0edca350a49210e16223a875d290 Mon Sep 17 00:00:00 2001 From: "RAMALINGAM, SUNDAR (sr7234)" Date: Wed, 25 Jul 2018 16:13:16 -0400 Subject: Reporting Enhancements Issue-ID: PORTAL-314 Remote DB logic is added to enhance RAPTOR to pull content from different DB as well as Different DB TYPE Change-Id: I5cb343cd9daa912d78e7a8e409d28c8845d9afb4 Signed-off-by: RAMALINGAM, SUNDAR (sr7234) --- .../xmlobj/RaptorControllerAsyncNewTest.java | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/RaptorControllerAsyncNewTest.java') diff --git a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/RaptorControllerAsyncNewTest.java b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/RaptorControllerAsyncNewTest.java index f761733b..5b2da9ca 100644 --- a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/RaptorControllerAsyncNewTest.java +++ b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/RaptorControllerAsyncNewTest.java @@ -161,7 +161,7 @@ public class RaptorControllerAsyncNewTest { Mockito.when(rsmd.getColumnCount()).thenReturn(1); Mockito.when(rs.getMetaData()).thenReturn(rsmd); DataSet datset = PowerMockito.mock(DataSet.class); - Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null); + Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null); Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset); Mockito.when(Globals.getNewScheduleData()).thenReturn("test"); CustomReportType customReportType = new CustomReportType(); @@ -241,7 +241,7 @@ public class RaptorControllerAsyncNewTest { Mockito.when(rsmd.getColumnCount()).thenReturn(1); Mockito.when(rs.getMetaData()).thenReturn(rsmd); DataSet datset = PowerMockito.mock(DataSet.class); - Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null); + Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null); Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset); Mockito.when(Globals.getNewScheduleData()).thenReturn("test"); CustomReportType customReportType = new CustomReportType(); @@ -301,7 +301,7 @@ public class RaptorControllerAsyncNewTest { Mockito.when(rsmd.getColumnCount()).thenReturn(1); Mockito.when(rs.getMetaData()).thenReturn(rsmd); DataSet datset = PowerMockito.mock(DataSet.class); - Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null); + Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null); Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset); Mockito.when(Globals.getNewScheduleData()).thenReturn("test"); CustomReportType customReportType = new CustomReportType(); @@ -370,7 +370,7 @@ public class RaptorControllerAsyncNewTest { Mockito.when(rsmd.getColumnCount()).thenReturn(1); Mockito.when(rs.getMetaData()).thenReturn(rsmd); DataSet datset = PowerMockito.mock(DataSet.class); - Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null); + Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null); Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset); Mockito.when(Globals.getNewScheduleData()).thenReturn("test"); CustomReportType customReportType = new CustomReportType(); @@ -431,7 +431,7 @@ public class RaptorControllerAsyncNewTest { Mockito.when(rsmd.getColumnCount()).thenReturn(1); Mockito.when(rs.getMetaData()).thenReturn(rsmd); DataSet datset = PowerMockito.mock(DataSet.class); - Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null); + Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null); Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset); Mockito.when(Globals.getNewScheduleData()).thenReturn("test"); CustomReportType customReportType = new CustomReportType(); @@ -467,7 +467,7 @@ public class RaptorControllerAsyncNewTest { Mockito.when(rsmd.getColumnCount()).thenReturn(1); Mockito.when(rs.getMetaData()).thenReturn(rsmd); DataSet datset = PowerMockito.mock(DataSet.class); - Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null); + Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null); Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset); Mockito.when(Globals.getNewScheduleData()).thenReturn("test"); CustomReportType customReportType = new CustomReportType(); @@ -509,7 +509,7 @@ public class RaptorControllerAsyncNewTest { Mockito.when(rsmd.getColumnCount()).thenReturn(1); Mockito.when(rs.getMetaData()).thenReturn(rsmd); DataSet datset = PowerMockito.mock(DataSet.class); - Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null); + Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null); Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset); Mockito.when(Globals.getNewScheduleData()).thenReturn("test"); CustomReportType customReportType = new CustomReportType(); @@ -572,7 +572,7 @@ public class RaptorControllerAsyncNewTest { Mockito.when(rsmd.getColumnCount()).thenReturn(1); Mockito.when(rs.getMetaData()).thenReturn(rsmd); DataSet datset = PowerMockito.mock(DataSet.class); - Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null); + Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null); Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset); Mockito.when(Globals.getNewScheduleData()).thenReturn("test"); CustomReportType customReportType = new CustomReportType(); @@ -599,7 +599,7 @@ public class RaptorControllerAsyncNewTest { Mockito.when(rsmd.getColumnCount()).thenReturn(1); Mockito.when(rs.getMetaData()).thenReturn(rsmd); DataSet datset = PowerMockito.mock(DataSet.class); - Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null); + Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null); Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset); Mockito.when(Globals.getNewScheduleData()).thenReturn("test"); CustomReportType customReportType = new CustomReportType(); @@ -836,7 +836,7 @@ public class RaptorControllerAsyncNewTest { Mockito.when(rsmd.getColumnCount()).thenReturn(1); Mockito.when(rs.getMetaData()).thenReturn(rsmd); DataSet datset = PowerMockito.mock(DataSet.class); - Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null); + Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null); Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset); Mockito.when(Globals.getNewScheduleData()).thenReturn("test"); CustomReportType customReportType = new CustomReportType(); @@ -943,7 +943,7 @@ public class RaptorControllerAsyncNewTest { Mockito.when(rsmd.getColumnCount()).thenReturn(1); Mockito.when(rs.getMetaData()).thenReturn(rsmd); DataSet datset = PowerMockito.mock(DataSet.class); - Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null); + Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null); Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset); Mockito.when(Globals.getNewScheduleData()).thenReturn("test"); CustomReportType customReportType = new CustomReportType(); @@ -1342,7 +1342,7 @@ public class RaptorControllerAsyncNewTest { public void retrieveDataForGivenQuery2Test() throws Exception { QueryJSON queryJSON = new QueryJSON(); - queryJSON.setQuery("select"); + queryJSON.setQuery("test"); ServletContext servletContext = PowerMockito.mock(ServletContext.class); Mockito.when(mockedRequest.getSession().getServletContext()).thenReturn(servletContext); ReportDefinition rdf1 = PowerMockito.mock(ReportDefinition.class); @@ -1378,8 +1378,7 @@ public class RaptorControllerAsyncNewTest { assertEquals(raptorControllerAsync.nvl("test"),"test"); assertEquals(raptorControllerAsync.nvl("","default"),"default"); assertEquals(raptorControllerAsync.nvl("test","default"),"test"); - - + raptorControllerAsync.retrieveDataForGivenQuery(false, queryJSON, mockedRequest, mockedResponse); } -- cgit 1.2.3-korg