test_class.file: server/src/test/java/io/spine/server/delivery/CatchUpStationTest.java
test_class.identifier: CatchUpStationTest
test_class.superclass: extends AbstractStationTest
test_case.body: @Test
      @DisplayName("run the delivery action " +
              "for the messages in `CATCH_UP` status sorting them beforehand")
      void sortCatchUpMessagesBeforeCallingToAction() {
          Timestamp now = currentTime();
          Timestamp secondBefore = subtract(now, fromSeconds(1));
          Timestamp twoSecondsBefore = subtract(now, fromSeconds(2));
          Timestamp threeSecondsBefore = subtract(now, fromSeconds(3));
  
          InboxMessage toCatchUp1 = catchingUp(targetOne, type, threeSecondsBefore);
          InboxMessage toCatchUp2 = catchingUp(targetOne, type, twoSecondsBefore);
          InboxMessage toCatchUp3 = catchingUp(targetOne, type, secondBefore);
          InboxMessage toCatchUp4 = catchingUp(targetOne, type, now);
          Conveyor conveyor = new Conveyor(
                  ImmutableList.of(toCatchUp3, toCatchUp2, toCatchUp4, toCatchUp1),
                  new DeliveredMessages()
          );
  
          CatchUp job = catchUpJob(type, IN_PROGRESS, currentTime(), ImmutableList.of(targetOne));
          MemoizingAction action = MemoizingAction.empty();
          CatchUpStation station = new CatchUpStation(action, ImmutableList.of(job));
          Station.Result result = station.process(conveyor);
          assertDeliveredCount(result, 4);
  
          List<InboxMessage> deliveredMessages = checkNotNull(action.passedMessages());
          assertThat(deliveredMessages).containsExactlyElementsIn(
                  ImmutableList.of(toCatchUp1, toCatchUp2, toCatchUp3, toCatchUp4)
          );
      }
test_case.class_method_signature: CatchUpStationTest.sortCatchUpMessagesBeforeCallingToAction()
test_case.full_signature: @Test @DisplayName("run the delivery action " + "for the messages in `CATCH_UP` status sorting them beforehand") void sortCatchUpMessagesBeforeCallingToAction()
test_case.identifier: sortCatchUpMessagesBeforeCallingToAction
test_case.invocations: currentTime subtract fromSeconds subtract fromSeconds subtract fromSeconds catchingUp catchingUp catchingUp catchingUp of catchUpJob currentTime of empty of process assertDeliveredCount checkNotNull passedMessages containsExactlyElementsIn assertThat of
test_case.modifiers: @Test @DisplayName("run the delivery action " + "for the messages in `CATCH_UP` status sorting them beforehand")
test_case.parameters: ()
test_case.return: void
test_case.signature: void sortCatchUpMessagesBeforeCallingToAction()
focal_class.declarator: HOW_LONG_TO_KEEP = Durations.fromMillis(1000)
focal_class.modifier: private static final
focal_class.original_string: private static final Duration HOW_LONG_TO_KEEP = Durations.fromMillis(1000);
focal_class.type: Duration
focal_class.var_name: HOW_LONG_TO_KEEP
focal_class.declarator: COMPARATOR = new CatchUpMessageComparator()
focal_class.modifier: private static final
focal_class.original_string: private static final Comparator<InboxMessage> COMPARATOR = new CatchUpMessageComparator();
focal_class.type: Comparator<InboxMessage>
focal_class.var_name: COMPARATOR
focal_class.declarator: action
focal_class.modifier: private final
focal_class.original_string: private final DeliveryAction action;
focal_class.type: DeliveryAction
focal_class.var_name: action
focal_class.declarator: jobs
focal_class.modifier: private final
focal_class.original_string: private final Iterable<CatchUp> jobs;
focal_class.type: Iterable<CatchUp>
focal_class.var_name: jobs
focal_class.file: server/src/main/java/io/spine/server/delivery/CatchUpStation.java
focal_class.identifier: CatchUpStation
focal_class.class_method_signature: CatchUpStation.CatchUpStation(DeliveryAction action, Iterable<CatchUp> jobs)
focal_class.full_signature:   CatchUpStation(DeliveryAction action, Iterable<CatchUp> jobs)
focal_class.identifier: CatchUpStation
focal_class.parameters: (DeliveryAction action, Iterable<CatchUp> jobs)
focal_class.signature:  CatchUpStation(DeliveryAction action, Iterable<CatchUp> jobs)
focal_class.class_method_signature: CatchUpStation.process(Conveyor conveyor)
focal_class.full_signature: @Override public final Result process(Conveyor conveyor)
focal_class.identifier: process
focal_class.modifiers: @Override public final
focal_class.parameters: (Conveyor conveyor)
focal_class.return: Result
focal_class.signature: Result process(Conveyor conveyor)
focal_class.class_method_signature: CatchUpStation.dispatch(Collection<InboxMessage> messages, Conveyor conveyor)
focal_class.full_signature: private Result dispatch(Collection<InboxMessage> messages, Conveyor conveyor)
focal_class.identifier: dispatch
focal_class.modifiers: private
focal_class.parameters: (Collection<InboxMessage> messages, Conveyor conveyor)
focal_class.return: Result
focal_class.signature: Result dispatch(Collection<InboxMessage> messages, Conveyor conveyor)
focal_class.superclass: extends Station
focal_method.body: @Override
      public final Result process(Conveyor conveyor) {
          JobFilter jobFilter = new JobFilter(jobs, conveyor);
          Collection<InboxMessage> toDispatch = jobFilter.messagesToDispatch();
          return dispatch(toDispatch, conveyor);
      }
focal_method.class_method_signature: CatchUpStation.process(Conveyor conveyor)
focal_method.full_signature: @Override public final Result process(Conveyor conveyor)
focal_method.identifier: process
focal_method.invocations: messagesToDispatch dispatch
focal_method.modifiers: @Override public final
focal_method.parameters: (Conveyor conveyor)
focal_method.return: Result
focal_method.signature: Result process(Conveyor conveyor)