public void testProcessActionParams() { getConfig().setAvoidValidationInUrlsWithoutParams(Boolean.FALSE); RequestContextHolder request = getRequestContext(); String url = "/testAction.do?param=1"; String result = linkUrlProcessor.processUrl(request, url); assertTrue(result.contains("_HDIV_STATE_")); }
public void testProcessAction() { getConfig().setAvoidValidationInUrlsWithoutParams(Boolean.FALSE); RequestContextHolder request = getRequestContext(); String url = "/testAction.do"; String result = linkUrlProcessor.processUrl(request, url); assertTrue(result.contains("_HDIV_STATE_")); }
public void testProcessActionAvoidParams() { getConfig().setAvoidValidationInUrlsWithoutParams(Boolean.TRUE); RequestContextHolder request = getRequestContext(); String url = "/testAction.do?param=1"; String result = linkUrlProcessor.processUrl(request, url); assertTrue(result.contains("_HDIV_STATE_")); }
public void testAvoidValidationWithAjaxCall() { getConfig().setAvoidValidationInUrlsWithoutParams(Boolean.TRUE); MockHttpServletRequest request = getMockRequest(); request.addHeader("x-requested-with", "XMLHttpRequest"); clearAjax(); String url = "/testAction.do"; String result = linkUrlProcessor.processUrl(getRequestContext(), url); assertTrue(!result.contains("_HDIV_STATE_")); }
public void testAvoidValidationWithAjaxCallWithParameters() { getConfig().setAvoidValidationInUrlsWithoutParams(Boolean.TRUE); MockHttpServletRequest request = getMockRequest(); request.addHeader("x-requested-with", "XMLHttpRequest"); clearAjax(); String url = "/testAction.do?param=1"; String result = linkUrlProcessor.processUrl(getRequestContext(), url); assertTrue(result.contains("_HDIV_STATE_")); }
public void testProcessActionComplete() { getConfig().setAvoidValidationInUrlsWithoutParams(Boolean.TRUE); RequestContextHolder request = getRequestContext(); IDataComposer dataComposer = dataComposerFactory.newInstance(request); request.setDataComposer(dataComposer); dataComposer.startPage(); String action = "/testAction.do"; String result = formUrlProcessor.processUrl(request, action); // Post urls are not modified assertEquals(action, result); String val = dataComposer.compose("param", "value", false); assertEquals("0", val); String requestId = dataComposer.endRequest(); assertNotNull(requestId); assertTrue(requestId.length() > 0); }