use of org.apache.kafka.common.message.DescribeConfigsResponseData.DescribeConfigsResourceResult in project kafka by apache.
the class RequestResponseTest method verifyDescribeConfigsResponse.
private void verifyDescribeConfigsResponse(DescribeConfigsResponse expected, DescribeConfigsResponse actual, short version) {
for (Map.Entry<ConfigResource, DescribeConfigsResult> resource : expected.resultMap().entrySet()) {
List<DescribeConfigsResourceResult> actualEntries = actual.resultMap().get(resource.getKey()).configs();
List<DescribeConfigsResourceResult> expectedEntries = expected.resultMap().get(resource.getKey()).configs();
assertEquals(expectedEntries.size(), actualEntries.size());
for (int i = 0; i < actualEntries.size(); ++i) {
DescribeConfigsResourceResult actualEntry = actualEntries.get(i);
DescribeConfigsResourceResult expectedEntry = expectedEntries.get(i);
assertEquals(expectedEntry.name(), actualEntry.name());
assertEquals(expectedEntry.value(), actualEntry.value(), "Non-matching values for " + actualEntry.name() + " in version " + version);
assertEquals(expectedEntry.readOnly(), actualEntry.readOnly(), "Non-matching readonly for " + actualEntry.name() + " in version " + version);
assertEquals(expectedEntry.isSensitive(), actualEntry.isSensitive(), "Non-matching isSensitive for " + actualEntry.name() + " in version " + version);
if (version < 3) {
assertEquals(ConfigType.UNKNOWN.id(), actualEntry.configType(), "Non-matching configType for " + actualEntry.name() + " in version " + version);
} else {
assertEquals(expectedEntry.configType(), actualEntry.configType(), "Non-matching configType for " + actualEntry.name() + " in version " + version);
}
if (version == 0) {
assertEquals(DescribeConfigsResponse.ConfigSource.STATIC_BROKER_CONFIG.id(), actualEntry.configSource(), "Non matching configSource for " + actualEntry.name() + " in version " + version);
} else {
assertEquals(expectedEntry.configSource(), actualEntry.configSource(), "Non-matching configSource for " + actualEntry.name() + " in version " + version);
}
}
}
}
Aggregations