Class ReadFileResourceFunction
java.lang.Object
org.citrusframework.functions.core.ReadFileResourceFunction
- All Implemented Interfaces:
org.citrusframework.functions.Function,org.citrusframework.functions.ParameterizedFunction<ReadFileResourceFunction.Parameters>
public class ReadFileResourceFunction
extends Object
implements org.citrusframework.functions.ParameterizedFunction<ReadFileResourceFunction.Parameters>
Function reads file from given file path and returns the complete file content as function result.
File content is automatically parsed for test variables.
File path can also have test variables as part of the file name or path.
The function accepts the following parameters:
- File path of the file resource to read
- Boolean value to indicate that the returned value should be base64 encoded. Defaults to false.
- Boolean value to indicate that a dynamic replacement should be performed before the content is base64 encoded. Defaults to false.
- Since:
- 2.4
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.citrusframework.functions.ParameterizedFunction
org.citrusframework.functions.ParameterizedFunction.FunctionParameters -
Field Summary
Fields inherited from interface org.citrusframework.functions.Function
functions, logger, RESOURCE_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(ReadFileResourceFunction.Parameters param, org.citrusframework.context.TestContext context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.citrusframework.functions.ParameterizedFunction
execute
-
Constructor Details
-
ReadFileResourceFunction
public ReadFileResourceFunction()
-
-
Method Details
-
execute
public String execute(ReadFileResourceFunction.Parameters param, org.citrusframework.context.TestContext context) - Specified by:
executein interfaceorg.citrusframework.functions.ParameterizedFunction<ReadFileResourceFunction.Parameters>
-
getParameters
- Specified by:
getParametersin interfaceorg.citrusframework.functions.ParameterizedFunction<ReadFileResourceFunction.Parameters>
-