import org.onap.policy.rest.dao.CommonClassDao;
import org.springframework.mock.web.MockHttpServletResponse;
import org.onap.policy.rest.dao.CommonClassDao;
import org.springframework.mock.web.MockHttpServletResponse;
private static CommonClassDao commonClassDao;
private HttpServletRequest request = null;
private HttpServletResponse response = null;
private DictionaryImportController controller = null;
private static CommonClassDao commonClassDao;
private HttpServletRequest request = null;
private HttpServletResponse response = null;
private DictionaryImportController controller = null;
controller = new DictionaryImportController();
new DictionaryImportController(commonClassDao);
request = Mockito.mock(HttpServletRequest.class);
controller = new DictionaryImportController();
new DictionaryImportController(commonClassDao);
request = Mockito.mock(HttpServletRequest.class);
@Test
public void testImportDictionaryData() throws ServletException, IOException{
List<String> fileNames = new ArrayList<>();
@Test
public void testImportDictionaryData() throws ServletException, IOException{
List<String> fileNames = new ArrayList<>();
fileNames.add("ActionPolicyDictionary.csv");
fileNames.add("OnapName.csv");
fileNames.add("MSPolicyDictionary.csv");
fileNames.add("ActionPolicyDictionary.csv");
fileNames.add("OnapName.csv");
fileNames.add("MSPolicyDictionary.csv");
fileNames.add("ClosedLoopService.csv");
fileNames.add("ClosedLoopSite.csv");
fileNames.add("VarbindDictionary.csv");
fileNames.add("ClosedLoopService.csv");
fileNames.add("ClosedLoopSite.csv");
fileNames.add("VarbindDictionary.csv");
}
when(request.getParameter("dictionaryName")).thenReturn("WrongName");
controller.importDictionaryData(request, response);
}
when(request.getParameter("dictionaryName")).thenReturn("WrongName");
controller.importDictionaryData(request, response);
when(request.getParameter("dictionaryName")).thenReturn("");
controller.importDictionaryData(request, response);
when(request.getParameter("dictionaryName")).thenReturn("");
controller.importDictionaryData(request, response);