@Test
public void testWatch() throws IOException {

    // Mock user utilities
    PowerMockito.mockStatic(UserUtils.class);
    User user = new User();
    user.setOrgUserId("testID");
    when(UserUtils.getUserSession(any())).thenReturn(user);
    // Mock database
    CommonClassDao dao = Mockito.mock(CommonClassDao.class);
    Mockito.when(dao.getDataByQuery(any(), any())).thenReturn(Collections.emptyList());
    // Test watch
    PolicyNotificationController controller = new PolicyNotificationController();
    controller.commonClassDao = dao;
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setBodyContent("{\n\"watchData\": {\"name\": \"testVal\",\"path\": \"testPath\"\n}}\n");
    MockHttpServletResponse response = new MockHttpServletResponse();
    ModelAndView model = controller.watchPolicy(request, response);
    assertNull(model);
    assertEquals(response.getStatusCode(), HttpServletResponse.SC_OK);
    // Negative test watch
    request.setBodyContent("{\n\"watchData\": {\"name\": \"testVal\",\"nopath\": \"testPath\"\n}}\n");
    response = new MockHttpServletResponse();
    model = controller.watchPolicy(request, response);
    assertNull(model);
    assertEquals(response.getStatusCode(), HttpServletResponse.SC_OK);
}