@Test(expectedExceptions = StringValidationException.class) public void testGetInterMediatePathException() { doReturn(TOKEN_MISSING).when(mockReferenceTokenReplacer).replaceReferenceTokens(anyString(), any()); doReturn(TOKEN_MISSING).when(mockPropertyRetriever).getField(IntermediatePathComposer.INTERMEDIATE_REQUIRED_PATH_TOKENS_KEY, null); paramsMap.put(IntermediatePathComposer.INTERMEDIATE_PATH_KEY, INTERMEDIATE_PATH); composer.retrieveIntermediatePath(mockLaunchDataWrapper, paramsMap, DEFAULT_INTERMEDIATE_PATH); }
public String retrieveIntermediatePath(LaunchDataWrapper launchDataWrapper, ParamsMap paramsMap, String defaultIntermediatePath) { if(paramsMap != null) { String intermediatePath = paramsMap.getString(INTERMEDIATE_PATH_KEY, null); if(StringUtils.isNotBlank(intermediatePath)) { validateIntermediatePath( intermediatePath, launchDataWrapper.getPropertyRetriever().getField(INTERMEDIATE_REQUIRED_PATH_TOKENS_KEY, null), launchDataWrapper); return intermediatePath; } } return defaultIntermediatePath; }
IntermediatePathComposer { public String retrieveIntermediatePath(LaunchDataWrapper launchDataWrapper, ParamsMap paramsMap, String defaultIntermediatePath) { if(paramsMap != null) { String intermediatePath = paramsMap.getString(INTERMEDIATE_PATH_KEY, null); if(StringUtils.isNotBlank(intermediatePath)) { validateIntermediatePath( intermediatePath, launchDataWrapper.getPropertyRetriever().getField(INTERMEDIATE_REQUIRED_PATH_TOKENS_KEY, null), launchDataWrapper); return intermediatePath; } } return defaultIntermediatePath; } }
IntermediatePathComposer { public String retrieveIntermediatePath(LaunchDataWrapper launchDataWrapper, ParamsMap paramsMap, String defaultIntermediatePath) { if(paramsMap != null) { String intermediatePath = paramsMap.getString(INTERMEDIATE_PATH_KEY, null); if(StringUtils.isNotBlank(intermediatePath)) { validateIntermediatePath( intermediatePath, launchDataWrapper.getPropertyRetriever().getField(INTERMEDIATE_REQUIRED_PATH_TOKENS_KEY, null), launchDataWrapper); return intermediatePath; } } return defaultIntermediatePath; } IntermediatePathComposer(); }
IntermediatePathComposer { public String retrieveIntermediatePath(LaunchDataWrapper launchDataWrapper, ParamsMap paramsMap, String defaultIntermediatePath) { if(paramsMap != null) { String intermediatePath = paramsMap.getString(INTERMEDIATE_PATH_KEY, null); if(StringUtils.isNotBlank(intermediatePath)) { validateIntermediatePath( intermediatePath, launchDataWrapper.getPropertyRetriever().getField(INTERMEDIATE_REQUIRED_PATH_TOKENS_KEY, null), launchDataWrapper); return intermediatePath; } } return defaultIntermediatePath; } IntermediatePathComposer(); IntermediatePathComposer setReferenceTokenReplacer(ReferenceTokenReplacer referenceTokenReplacer); IntermediatePathComposer setTokenStringValidatorFactory(TokenStringValidatorFactory tokenStringValidatorFactory); String retrieveIntermediatePath(LaunchDataWrapper launchDataWrapper, ParamsMap paramsMap, String defaultIntermediatePath); void configureIntermediatePath(ParamsMap paramsMap, String intermediatePath); }
IntermediatePathComposer { public String retrieveIntermediatePath(LaunchDataWrapper launchDataWrapper, ParamsMap paramsMap, String defaultIntermediatePath) { if(paramsMap != null) { String intermediatePath = paramsMap.getString(INTERMEDIATE_PATH_KEY, null); if(StringUtils.isNotBlank(intermediatePath)) { validateIntermediatePath( intermediatePath, launchDataWrapper.getPropertyRetriever().getField(INTERMEDIATE_REQUIRED_PATH_TOKENS_KEY, null), launchDataWrapper); return intermediatePath; } } return defaultIntermediatePath; } IntermediatePathComposer(); IntermediatePathComposer setReferenceTokenReplacer(ReferenceTokenReplacer referenceTokenReplacer); IntermediatePathComposer setTokenStringValidatorFactory(TokenStringValidatorFactory tokenStringValidatorFactory); String retrieveIntermediatePath(LaunchDataWrapper launchDataWrapper, ParamsMap paramsMap, String defaultIntermediatePath); void configureIntermediatePath(ParamsMap paramsMap, String intermediatePath);  }