private DescribeConfigsResponse describeConfigsResponse(ApiError error, NewTopic... topics) {
        List<DescribeConfigsResponseData.DescribeConfigsResult> results = Stream.of(topics)
                .map(topic -> new DescribeConfigsResponseData.DescribeConfigsResult()
                        .setErrorCode(error.error().code())
                        .setErrorMessage(error.message())
                        .setResourceType(ConfigResource.Type.TOPIC.id())
                        .setResourceName(topic.name())
                        .setConfigs(topic.configs().entrySet()
                                .stream()
                                .map(e -> new DescribeConfigsResponseData.DescribeConfigsResourceResult()
                                        .setName(e.getKey())
                                        .setValue(e.getValue()))
                                .collect(Collectors.toList())))
                .collect(Collectors.toList());
        return new DescribeConfigsResponse(new DescribeConfigsResponseData().setThrottleTimeMs(1000).setResults(results));
    }
Create a ListOffsetResponse that exposes the supplied error and includes offsets for the supplied partitions.
@param error               the error; may be null if an unknown error should be used
@param offsetsByPartitions offset for each partition, where offset is null signals the error should be used
@return the response
connect/runtime/src/test/java/org/apache/kafka/connect/util/TopicAdminTest.java