Class ScriptModelBuilder
java.lang.Object
org.junit.rules.ExternalResource
de.hybris.platform.integrationservices.scripting.ScriptModelBuilder
- All Implemented Interfaces:
org.junit.rules.TestRule
public final class ScriptModelBuilder
extends org.junit.rules.ExternalResource
A builder for creating scripts in the integration tests.
-
Method Summary
Modifier and TypeMethodDescriptionprotected voidafter()protected voidbefore()voidbuild()Builds a script model with the values specified bywith...methods.voidcleanup()Removes all script models from the database.static ScriptModelBuilderCreates a script builder with GROOVY script type already specified.static ScriptModelBuilderscript()Creates a script builder without a script type specified.Specifies code (ID) of the script in the model to create.withContent(String content) Specifies content of the script.withDisabled(boolean disabled) Specifies whether this script is disabled or not.withType(ScriptType type) Specifies a programming language to be used for the script content.Methods inherited from class org.junit.rules.ExternalResource
apply
-
Method Details
-
groovyScript
Creates a script builder with GROOVY script type already specified.- Returns:
- a new script builder to use
-
script
Creates a script builder without a script type specified.- Returns:
- a new script builder to use
-
withCode
Specifies code (ID) of the script in the model to create.- Parameters:
code- unique identifier of the script- Returns:
- a builder with the code specified.
-
withType
Specifies a programming language to be used for the script content. If script type is not specified, i.e. this method is not called, then defaultScriptType.GROOVYwill be used.- Parameters:
type- a script type (language) to use for the script being created.- Returns:
- a builder with the script type specified.
-
withContent
Specifies content of the script.- Parameters:
content- the script content written in theScriptTypelanguage.- Returns:
- a builder with the script content specified
-
withDisabled
Specifies whether this script is disabled or not.- Parameters:
disabled-trueif script will be disabled otherwisefalse.- Returns:
- a builder with the script disabled value specified
-
build
Builds a script model with the values specified bywith...methods.- Throws:
ImpExException- if provided values are not correct for the impex script to create the model in the database.
-
cleanup
public void cleanup()Removes all script models from the database. -
before
- Overrides:
beforein classorg.junit.rules.ExternalResource- Throws:
ImpExException
-
after
protected void after()- Overrides:
afterin classorg.junit.rules.ExternalResource
-