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 Details

    • destinationTarget

      public static DestinationTargetBuilder destinationTarget()
      Instantiates a new builder initialized to default state.
      Returns:
      new destination target builder
    • withId

      public DestinationTargetBuilder withId(String id)
      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

      public DestinationTargetBuilder withDestinationChannel(DestinationChannel channel)
      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 is null or this method was not called, then the platform default channel will be used.
      Returns:
      a builder with the destination channel specified.
    • withRegistrationStatus

      public DestinationTargetBuilder withRegistrationStatus(RegistrationStatus status)
      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 is null or this method was not called, then destination target will be created without the registration status.
      Returns:
      a builder with the registration status specified.
    • build

      public DestinationTargetModel build() throws ImpExException
      Throws:
      ImpExException
    • getDestinationTargetById

      public static Optional<DestinationTargetModel> getDestinationTargetById(String id)
      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:
      after in class org.junit.rules.ExternalResource
    • cleanup

      public void cleanup()
      Deletes all destination targets created by this builder.