Class JournalServiceTester


  • public class JournalServiceTester
    extends Object
    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
    • Constructor Detail

      • JournalServiceTester

        public JournalServiceTester()
    • Method Detail

      • getLatestEntry

        public JournalEntry getLatestEntry​(String journalUrl)
        Parameters:
        journalUrl -
        Returns:
        the latest journal entry, we do retry the journaling API, up to pollingTimeOutInMs, if it fails (due to temporary failure, or cache propagation latencies).
      • pollJournalForEvents

        public boolean pollJournalForEvents​(String journalUrl,
                                            Set<String> eventIds,
                                            BiPredicate<Event,​String> isEventIdInEvent)
        Polls the journal for the given eventIds. The journal is polled until all eventIds are found. The timeout is set to 2 minutes.
        Parameters:
        journalUrl - The journal url
        eventIds - The eventIds to find (the set is not modified)
        isEventIdInEvent - The predicate to use to find the eventIds in the journal
        Returns:
        true if all eventIds are found, false otherwise (if timeout is reached).
      • pollJournalForEvents

        public boolean pollJournalForEvents​(String journalUrl,
                                            Set<String> eventIds,
                                            BiPredicate<Event,​String> isEventIdInEvent,
                                            long timeoutInMilliseconds)
        Polls the journal for the given eventIds. The journal is polled until all eventIds are found.
        Parameters:
        journalUrl - The journal url
        eventIds - The eventIds to find (the set is not modified)
        isEventIdInEvent - The predicate to use to find the eventIds in the journal
        timeoutInMilliseconds - The timeout in milliseconds
        Returns:
        true if all eventIds are found, false otherwise (if timeout is reached).