Class DestinationTargetBuilder
java.lang.Object
org.junit.rules.ExternalResource
de.hybris.platform.outboundservices.DestinationTargetBuilder
- All Implemented Interfaces:
org.junit.rules.TestRule
public class DestinationTargetBuilder
extends org.junit.rules.ExternalResource
A helper to be used in integration tests for creating and persisting
DestinationTargetModel-
Method Summary
Modifier and TypeMethodDescriptionprotected voidafter()build()voidcleanup()Deletes all destination targets created by this builder.static DestinationTargetBuilderInstantiates a new builder initialized to default state.static Optional<DestinationTargetModel>Looks up a destination target in the persistence storage.withDestinationChannel(DestinationChannel channel) Specifies the destination channel for the destination target being built.Specifies ID for the destination target to build.Specifies registration status for the destination target.Methods inherited from class org.junit.rules.ExternalResource
apply, before
-
Method Details
-
destinationTarget
Instantiates a new builder initialized to default state.- Returns:
- new destination target builder
-
withId
Specifies ID for the destination target to build.- Parameters:
id- identifier of the destination target to create. If the value is- Returns:
- the builder with the ID specified
-
withDestinationChannel
Specifies the destination channel for the destination target being built.- Parameters:
channel- destination channel to be used by the destination target. If the channel value isnullor this method was not called, then the platform default channel will be used.- Returns:
- a builder with the destination channel specified.
-
withRegistrationStatus
Specifies registration status for the destination target.- Parameters:
status- a status to be used by the destination target being built by this builder. If the value isnullor this method was not called, then destination target will be created without the registration status.- Returns:
- a builder with the registration status specified.
-
build
- Throws:
ImpExException
-
getDestinationTargetById
Looks up a destination target in the persistence storage.- Parameters:
id- ID of the destination target to find.- Returns:
- an optional containing the matching destination target or
Optional.empty(), if such destination target does not exist.
-
after
protected void after()- Overrides:
afterin classorg.junit.rules.ExternalResource
-
cleanup
public void cleanup()Deletes all destination targets created by this builder.
-