|
|
|
@ -79,7 +79,7 @@ class OffsetCommitTest extends JUnit3Suite with ZooKeeperTestHarness {
@@ -79,7 +79,7 @@ class OffsetCommitTest extends JUnit3Suite with ZooKeeperTestHarness {
|
|
|
|
|
// create the topic |
|
|
|
|
createTopic(zkClient, topic, partitionReplicaAssignment = expectedReplicaAssignment, servers = Seq(server)) |
|
|
|
|
|
|
|
|
|
val commitRequest = OffsetCommitRequest("test-group", immutable.Map(topicAndPartition -> OffsetAndMetadata(offset=42L))) |
|
|
|
|
val commitRequest = OffsetCommitRequest(group, immutable.Map(topicAndPartition -> OffsetAndMetadata(offset=42L))) |
|
|
|
|
val commitResponse = simpleConsumer.commitOffsets(commitRequest) |
|
|
|
|
|
|
|
|
|
assertEquals(ErrorMapping.NoError, commitResponse.commitStatus.get(topicAndPartition).get) |
|
|
|
@ -109,6 +109,13 @@ class OffsetCommitTest extends JUnit3Suite with ZooKeeperTestHarness {
@@ -109,6 +109,13 @@ class OffsetCommitTest extends JUnit3Suite with ZooKeeperTestHarness {
|
|
|
|
|
assertEquals("some metadata", fetchResponse1.requestInfo.get(topicAndPartition).get.metadata) |
|
|
|
|
assertEquals(100L, fetchResponse1.requestInfo.get(topicAndPartition).get.offset) |
|
|
|
|
|
|
|
|
|
// Fetch an unknown topic and verify |
|
|
|
|
val unknownTopicAndPartition = TopicAndPartition("unknownTopic", 0) |
|
|
|
|
val fetchRequest2 = OffsetFetchRequest(group, Seq(unknownTopicAndPartition)) |
|
|
|
|
val fetchResponse2 = simpleConsumer.fetchOffsets(fetchRequest2) |
|
|
|
|
|
|
|
|
|
assertEquals(OffsetMetadataAndError.UnknownTopicOrPartition, fetchResponse2.requestInfo.get(unknownTopicAndPartition).get) |
|
|
|
|
assertEquals(1, fetchResponse2.requestInfo.size) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|