/** * @return true if users are to be redirected when a step error occurs */ public static boolean isErrorRedirect() { return !Util.empty(getErrorUrl()); }
String url = StepCountUtil.getErrorUrl(); LOG.warn("User will be redirected to an error page. URL: " + url); try {
@Test public void testErrorUrl() { String testUrl = "test"; Configuration config = Config.copyConfiguration(originalConfig); // Clear current property (if exists) config.clearProperty(ConfigurationProperties.STEP_ERROR_URL); // Set redirect url config.addProperty(ConfigurationProperties.STEP_ERROR_URL, testUrl); Config.setConfiguration(config); Assert.assertEquals("Incorrect error url returned", testUrl, StepCountUtil.getErrorUrl()); }
} else if (StepCountUtil.isErrorRedirect()) { // Redirect to error page LOG.warn("User will be redirected to an error page."); redirectUrl = StepCountUtil.getErrorUrl(); } else { // Warp to the future by refreshing the page LOG.warn("Warp the user back to the future by refreshing the page.");