Package de.hybris.platform.outboundsync
Class TestItemChangeDetector
- java.lang.Object
-
- org.junit.rules.ExternalResource
-
- de.hybris.platform.outboundsync.TestItemChangeDetector
-
- All Implemented Interfaces:
org.junit.rules.TestRule
public class TestItemChangeDetector extends org.junit.rules.ExternalResourceA jUnit test rule for verifying item change conditions and creating/managing the change streams associated with the items changes.
-
-
Constructor Summary
Constructors Constructor Description TestItemChangeDetector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafter()voidconsumeAllCurrentChanges()Consumes all changes, which possibly present in all so far created streams.OutboundSyncStreamConfigurationModelcreateChangeStream(OutboundChannelConfigurationModel channel, java.lang.String typecode)Creates new delta detect stream and guarantees it has no outstanding changes in it.OutboundSyncStreamConfigurationModelcreateChangeStream(OutboundChannelConfigurationModel channel, java.lang.String typecode, java.lang.String filter)Creates new delta detect stream and guarantees it has no outstanding changes in it.OutboundSyncStreamConfigurationModelcreateChangeStream(java.lang.String channelCode, java.lang.String typecode)Creates new delta detect stream and guarantees it has no outstanding changes in it.OutboundSyncStreamConfigurationModelcreateChangeStream(java.lang.String channelCode, java.lang.String typecode, java.lang.String filter)Creates new delta detect stream and guarantees it has no outstanding changes in it.voidcreateChannel(java.lang.String channelCode, java.lang.String io, ConsumedDestinationModel destination)Creates an outbound channel configurationjava.util.List<ItemChangeDTO>getAllCurrentChanges()Retrieves all changes from all created change stream, which have not been consumed yet.booleanhasAllChangesConsumed()Determines whether any of the created change streams has unconsumed item changes.voidreset()Resets its state by consuming all changes in all created change streams and deletes the created change streams.
-
-
-
Method Detail
-
after
protected void after()
- Overrides:
afterin classorg.junit.rules.ExternalResource
-
reset
public void reset()
Resets its state by consuming all changes in all created change streams and deletes the created change streams. This method does not affect streams created outside of this rule class.
-
consumeAllCurrentChanges
public void consumeAllCurrentChanges()
Consumes all changes, which possibly present in all so far created streams.
-
hasAllChangesConsumed
public boolean hasAllChangesConsumed()
Determines whether any of the created change streams has unconsumed item changes.- Returns:
true, if all changes are consumed;false, if at least one unconsumed item change is present in at least of of the created streams.- See Also:
createChangeStream(String, String, String),getAllCurrentChanges()
-
getAllCurrentChanges
public java.util.List<ItemChangeDTO> getAllCurrentChanges()
Retrieves all changes from all created change stream, which have not been consumed yet.- Returns:
- a list of item changes or an empty list, if there are no outstanding unconsumed changes.
-
createChannel
public void createChannel(java.lang.String channelCode, java.lang.String io, ConsumedDestinationModel destination) throws ImpExExceptionCreates an outbound channel configuration- Parameters:
channelCode- code for the channel to createio- integration object code to associate with the channeldestination- a consumed destination model to associate with the channel- Throws:
ImpExException
-
createChangeStream
public OutboundSyncStreamConfigurationModel createChangeStream(OutboundChannelConfigurationModel channel, java.lang.String typecode) throws ImpExException
Creates new delta detect stream and guarantees it has no outstanding changes in it.- Parameters:
channel- a delta detect channel, the new stream should associated with.typecode- type code of a type system item, the stream should contain changes for.- Returns:
- the created change stream
- Throws:
ImpExException
-
createChangeStream
public OutboundSyncStreamConfigurationModel createChangeStream(OutboundChannelConfigurationModel channel, java.lang.String typecode, java.lang.String filter) throws ImpExException
Creates new delta detect stream and guarantees it has no outstanding changes in it.- Parameters:
channel- a delta detect channel, the new stream should associated with.typecode- type code of a type system item, the stream should contain changes for.filter- additionalwhereclause condition to be applied to the items in the stream. Only changes for the items matching this conditions will be reported by the stream. Changes done to the non-matching items will no be contained in this stream.- Returns:
- the created change stream
- Throws:
ImpExException
-
createChangeStream
public OutboundSyncStreamConfigurationModel createChangeStream(java.lang.String channelCode, java.lang.String typecode) throws ImpExException
Creates new delta detect stream and guarantees it has no outstanding changes in it.- Parameters:
channelCode- code of the corresponding delta detect channel, the new stream should associated with.typecode- type code of a type system item, the stream should contain changes for.- Returns:
- the created change stream
- Throws:
ImpExException
-
createChangeStream
public OutboundSyncStreamConfigurationModel createChangeStream(java.lang.String channelCode, java.lang.String typecode, java.lang.String filter) throws ImpExException
Creates new delta detect stream and guarantees it has no outstanding changes in it.- Parameters:
channelCode- code of the corresponding delta detect channel, the new stream should associated with.typecode- type code of a type system item, the stream should contain changes for.filter- additionalwhereclause condition to be applied to the items in the stream. Only changes for the items matching this conditions will be reported by the stream. Changes done to the non-matching items will no be contained in this stream.- Returns:
- the created change stream
- Throws:
ImpExException
-
-