@Test(enabled = true) public void testGetPreloadNotExistentString() { underTest = new PlaceholderHandler(); Map<String, Object> beforeSuiteVariables = new HashMap(); beforeSuiteVariables.put("preloadedVarName", "preloadedVarValue"); TestSuiteHandler.getInstance().getTestCaseUtils().setBeforeSuiteVariables(beforeSuiteVariables); String stringToProcess = "${preload[NotpreloadedVarName]}"; Object o = underTest.placeholderProcessString(stringToProcess); Assert.assertEquals(stringToProcess, o, "When a preloaded variable is not found, the string should be unmodified"); }
public Object placeholderProcessString(String inputStr) { logUtils.trace("inputStr = '{}'", inputStr); Object outputObj = inputStr; try { if (inputStr.contains(PLACEHOLDER_SYMBOL_BEGIN)) { outputObj = processGetStepPlaceholder(outputObj.toString()); outputObj = processPathPlaceholder(outputObj.toString()); outputObj = processPreloadPlaceholders(outputObj.toString()); outputObj = processCookiePlaceholder(outputObj.toString()); outputObj = processHeaderPlaceholder(outputObj.toString()); outputObj = processPlaceholderFromExternalModules(outputObj.toString()); } } catch (Exception oEx) { logUtils.error("catched exception message: '{}' \n cause: '{}'", oEx.getLocalizedMessage(), oEx.getCause()); } return outputObj; }
PlaceholderHandler { public Object placeholderProcessString(String inputStr) { logUtils.trace("inputStr = '{}'", inputStr); Object outputObj = inputStr; try { if (inputStr.contains(PLACEHOLDER_SYMBOL_BEGIN)) { outputObj = processGetStepPlaceholder(outputObj.toString()); outputObj = processPathPlaceholder(outputObj.toString()); outputObj = processPreloadPlaceholders(outputObj.toString()); outputObj = processCookiePlaceholder(outputObj.toString()); outputObj = processHeaderPlaceholder(outputObj.toString()); outputObj = processPlaceholderFromExternalModules(outputObj.toString()); } } catch (Exception oEx) { logUtils.error("catched exception message: '{}' \n cause: '{}'", oEx.getLocalizedMessage(), oEx.getCause()); } return outputObj; } }
PlaceholderHandler { public Object placeholderProcessString(String inputStr) { logUtils.trace("inputStr = '{}'", inputStr); Object outputObj = inputStr; try { if (inputStr.contains(PLACEHOLDER_SYMBOL_BEGIN)) { outputObj = processGetStepPlaceholder(outputObj.toString()); outputObj = processPathPlaceholder(outputObj.toString()); outputObj = processPreloadPlaceholders(outputObj.toString()); outputObj = processCookiePlaceholder(outputObj.toString()); outputObj = processHeaderPlaceholder(outputObj.toString()); outputObj = processPlaceholderFromExternalModules(outputObj.toString()); } } catch (Exception oEx) { logUtils.error("catched exception message: '{}' \n cause: '{}'", oEx.getLocalizedMessage(), oEx.getCause()); } return outputObj; } PlaceholderHandler(); }
PlaceholderHandler { public Object placeholderProcessString(String inputStr) { logUtils.trace("inputStr = '{}'", inputStr); Object outputObj = inputStr; try { if (inputStr.contains(PLACEHOLDER_SYMBOL_BEGIN)) { outputObj = processGetStepPlaceholder(outputObj.toString()); outputObj = processPathPlaceholder(outputObj.toString()); outputObj = processPreloadPlaceholders(outputObj.toString()); outputObj = processCookiePlaceholder(outputObj.toString()); outputObj = processHeaderPlaceholder(outputObj.toString()); outputObj = processPlaceholderFromExternalModules(outputObj.toString()); } } catch (Exception oEx) { logUtils.error("catched exception message: '{}' \n cause: '{}'", oEx.getLocalizedMessage(), oEx.getCause()); } return outputObj; } PlaceholderHandler(); Map<String, HeatPlaceholderModuleProvider> constructProviderMap(Map<String, HeatPlaceholderModuleProvider> providerMapInput,
            List<String> handledPlaceholders,
            HeatPlaceholderModuleProvider provider); Object placeholderProcessString(String inputStr); String getPathVar(String inputObj); String processHeaderPlaceholder(String inputString); Map<String, Object> placeholderProcessMap(Map<String, Object> requestParamsMap); void setResponse(Response rsp); void setPreloadedVariables(Map<String, Object> preloadedVarsInput); Map<String, Object> getPreloadedVariables(); void setFlowVariables(Map<Integer, Map<String, String>> flowPreloadedVariables); }
PlaceholderHandler { public Object placeholderProcessString(String inputStr) { logUtils.trace("inputStr = '{}'", inputStr); Object outputObj = inputStr; try { if (inputStr.contains(PLACEHOLDER_SYMBOL_BEGIN)) { outputObj = processGetStepPlaceholder(outputObj.toString()); outputObj = processPathPlaceholder(outputObj.toString()); outputObj = processPreloadPlaceholders(outputObj.toString()); outputObj = processCookiePlaceholder(outputObj.toString()); outputObj = processHeaderPlaceholder(outputObj.toString()); outputObj = processPlaceholderFromExternalModules(outputObj.toString()); } } catch (Exception oEx) { logUtils.error("catched exception message: '{}' \n cause: '{}'", oEx.getLocalizedMessage(), oEx.getCause()); } return outputObj; } PlaceholderHandler(); Map<String, HeatPlaceholderModuleProvider> constructProviderMap(Map<String, HeatPlaceholderModuleProvider> providerMapInput,
            List<String> handledPlaceholders,
            HeatPlaceholderModuleProvider provider); Object placeholderProcessString(String inputStr); String getPathVar(String inputObj); String processHeaderPlaceholder(String inputString); Map<String, Object> placeholderProcessMap(Map<String, Object> requestParamsMap); void setResponse(Response rsp); void setPreloadedVariables(Map<String, Object> preloadedVarsInput); Map<String, Object> getPreloadedVariables(); void setFlowVariables(Map<Integer, Map<String, String>> flowPreloadedVariables); static final String DEFAULT_PRELOADED_VALUE; static final String PLACEHOLDER_SYMBOL; static final String PLACEHOLDER_SYMBOL_BEGIN; static final String PLACEHOLDER_SYMBOL_END; static final String PLACEHOLDER_JSON_SCHEMA_NO_CHECK; static final String PATH_PLACEHOLDER; static final String PLACEHOLDER_NOT_PRESENT; static final String PLACEHOLDER_PRESENT; static final String PATH_JSONPATH_REGEXP; }