use of org.apache.kafka.common.metadata.FeatureLevelRecord in project kafka by apache.
the class FeatureControlManagerTest method testFeatureControlIterator.
@Test
public void testFeatureControlIterator() throws Exception {
SnapshotRegistry snapshotRegistry = new SnapshotRegistry(new LogContext());
FeatureControlManager manager = new FeatureControlManager(rangeMap("foo", 1, 5, "bar", 1, 2), snapshotRegistry);
ControllerResult<Map<String, ApiError>> result = manager.updateFeatures(rangeMap("foo", 1, 5, "bar", 1, 1), Collections.emptySet(), Collections.emptyMap());
RecordTestUtils.replayAll(manager, result.records());
RecordTestUtils.assertBatchIteratorContains(Arrays.asList(Arrays.asList(new ApiMessageAndVersion(new FeatureLevelRecord().setName("foo").setMinFeatureLevel((short) 1).setMaxFeatureLevel((short) 5), (short) 0)), Arrays.asList(new ApiMessageAndVersion(new FeatureLevelRecord().setName("bar").setMinFeatureLevel((short) 1).setMaxFeatureLevel((short) 1), (short) 0))), manager.iterator(Long.MAX_VALUE));
}
Aggregations