use of org.apache.kafka.streams.errors.TaskMigratedException in project apache-kafka-on-k8s by banzaicloud.
the class AssignedStreamsTasksTest method shouldCloseTaskOnCommitIfTaskMigratedException.
@Test
public void shouldCloseTaskOnCommitIfTaskMigratedException() {
mockTaskInitialization();
t1.commit();
EasyMock.expectLastCall().andThrow(new TaskMigratedException(t1));
t1.close(false, true);
EasyMock.expectLastCall();
EasyMock.replay(t1);
addAndInitTask();
try {
assignedTasks.commit();
fail("Should have thrown TaskMigratedException.");
} catch (final TaskMigratedException expected) {
/* ignore */
}
assertThat(assignedTasks.runningTaskIds(), equalTo(Collections.EMPTY_SET));
EasyMock.verify(t1);
}
Aggregations