Class TestItemChangeDetector

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public class TestItemChangeDetector
    extends org.junit.rules.ExternalResource
    A jUnit test rule for verifying item change conditions and creating/managing the change streams associated with the items changes.
    • Constructor Detail

      • TestItemChangeDetector

        public TestItemChangeDetector()
    • Method Detail

      • after

        protected void after()
        Overrides:
        after in class org.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.
      • 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 ImpExException
        Creates an outbound channel configuration
        Parameters:
        channelCode - code for the channel to create
        io - integration object code to associate with the channel
        destination - 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 - additional where clause 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 - additional where clause 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