@Test
  public void testCheckpoint() {
    createTopic(INPUT_STREAM, 2);
    produceMessages(0);
    produceMessages(1);

    // run application once and verify processed messages before shutdown
    runApplication(new CheckpointApplication(true), "CheckpointApplication", CONFIGS).getRunner().waitForFinish();
    verifyProcessedMessagesFirstRun();

    // run application a second time and verify that certain messages had to be re-processed
    runApplication(new CheckpointApplication(false), "CheckpointApplication", CONFIGS).getRunner().waitForFinish();
    verifyProcessedMessagesSecondRun();
  }
If message equals this string, then shut down the task.
samza-test/src/test/java/org/apache/samza/test/kafka/KafkaCheckpointManagerIntegrationTest.java