+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testGetDictionaryController() throws IOException {
+ PolicyRestController controller = new PolicyRestController();
+ HttpServletRequest mockRequest = Mockito.mock(HttpServletRequest.class);
+ HttpServletResponse mockResponse = Mockito.mock(HttpServletResponse.class);
+ PrintWriter mockPrintWriter = Mockito.mock(PrintWriter.class);
+
+ when(mockRequest.getRequestURI()).thenReturn("//testRequestURI///getDictionary");
+ when(mockResponse.getWriter()).thenThrow(IOException.class);
+ controller.getDictionaryController(mockRequest, mockResponse);
+ verify(mockRequest, atLeast(1)).getRequestURI();
+ verify(mockResponse, atLeast(1)).getWriter();
+
+ reset(mockResponse);
+ when(mockRequest.getRequestURI()).thenReturn("testRequestURI///getDictionary");
+ when(mockResponse.getWriter()).thenReturn(mockPrintWriter);
+ controller.getDictionaryController(mockRequest, mockResponse);
+ verify(mockRequest, atLeast(1)).getRequestURI();
+ verify(mockResponse, atLeast(1)).getWriter();
+ }