diff options
author | 2020-05-05 12:20:30 -0400 | |
---|---|---|
committer | 2020-05-16 01:50:52 +0530 | |
commit | 759e9e75fc0b5978f98f901744c87c0c8d5ef4fd (patch) | |
tree | 4b61ca0a05ec79d45f88b81142264e0407d2ddb3 /ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/RaptorControllerAsyncNewTest.java | |
parent | 03abc05e6217274f557ec4987aa8e8bd34b2f4a4 (diff) |
Raptor backend java API Code(Analytics), UI Code(Overlay) and pages
component in os project
Issue-ID: PORTAL-902
Change-Id: Id297d9493a77e6816ed0f2a82c15b2eaa1e57a72
Signed-off-by: Sudarshan Kumar <sudarshan.kumar@att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/RaptorControllerAsyncNewTest.java')
-rw-r--r-- | ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/xmlobj/RaptorControllerAsyncNewTest.java | 15 |
1 files changed, 10 insertions, 5 deletions
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 5b2da9ca..e69e32d3 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 @@ -37,9 +37,9 @@ */ package org.onap.portalsdk.analytics.xmlobj; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; -import java.io.IOException; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.util.ArrayList; @@ -66,7 +66,6 @@ import org.mockito.MockitoAnnotations; import org.onap.portalsdk.analytics.controller.Action; import org.onap.portalsdk.analytics.controller.ActionMapping; import org.onap.portalsdk.analytics.error.RaptorException; -import org.onap.portalsdk.analytics.error.ReportSQLException; import org.onap.portalsdk.analytics.model.DataCache; import org.onap.portalsdk.analytics.model.ReportHandler; import org.onap.portalsdk.analytics.model.ReportLoader; @@ -91,6 +90,7 @@ import org.onap.portalsdk.analytics.system.Globals; import org.onap.portalsdk.analytics.system.fusion.web.RaptorControllerAsync; import org.onap.portalsdk.analytics.util.AppConstants; import org.onap.portalsdk.analytics.util.DataSet; +import org.onap.portalsdk.analytics.util.RemDbInfo; import org.onap.portalsdk.analytics.util.Utils; import org.onap.portalsdk.analytics.util.XSSFilter; import org.onap.portalsdk.core.service.DataAccessService; @@ -142,7 +142,7 @@ public class RaptorControllerAsyncNewTest { MockRunTimeReport mockRunTimeReport = new MockRunTimeReport(); - @Test(expected = org.onap.portalsdk.analytics.error.ValidationException.class) + @Test public void retrieveDataForGivenQueryTest() throws Exception { QueryJSON queryJSON = new QueryJSON(); @@ -215,9 +215,14 @@ public class RaptorControllerAsyncNewTest { Mockito.when(encoder.encodeForSQL(Matchers.any(Codec.class),Matchers.anyString())).thenReturn("select *"); PowerMockito.mockStatic(ConnectionUtils.class); DataSet set = new DataSet(); - Mockito.when(ConnectionUtils.getDataSet("test", "local", true)).thenReturn(set); + //Mockito.when(ConnectionUtils.getDataSet("test", "local", true)).thenReturn(set); PowerMockito.mockStatic(XSSFilter.class); Mockito.when(XSSFilter.filterRequestOnlyScript(Matchers.anyString())).thenReturn("select distinct from test"); + + RemDbInfo remDbInfo = Mockito.mock(RemDbInfo.class); + PowerMockito.whenNew(RemDbInfo.class).withNoArguments().thenReturn(remDbInfo); + rdf.setRemDbInfo(remDbInfo); + Mockito.when(ConnectionUtils.getDataSet("test", rdf.getDBInfo(), true)).thenReturn(set); raptorControllerAsync.retrieveDataForGivenQuery(false, queryJSON, mockedRequest, mockedResponse); } |