private FetchSnapshotResponse createFetchSnapshotResponse() {
        FetchSnapshotResponseData data = new FetchSnapshotResponseData()
                .setErrorCode(Errors.NONE.code())
                .setTopics(singletonList(new FetchSnapshotResponseData.TopicSnapshot()
                        .setName("topic1")
                        .setPartitions(singletonList(new FetchSnapshotResponseData.PartitionSnapshot()
                                .setErrorCode(Errors.NONE.code())
                                .setIndex(0)
                                .setCurrentLeader(new FetchSnapshotResponseData.LeaderIdAndEpoch()
                                        .setLeaderEpoch(0)
                                        .setLeaderId(1))
                                .setSnapshotId(new FetchSnapshotResponseData.SnapshotId()
                                        .setEndOffset(123L)
                                        .setEpoch(0))
                                .setPosition(234L)
                                .setSize(345L)
                                .setUnalignedRecords(MemoryRecords.withRecords(Compression.NONE, new SimpleRecord("blah".getBytes())))))))
                .setThrottleTimeMs(123);
        return new FetchSnapshotResponse(data);
    }
Check that all error codes in the response get included in {@link AbstractResponse#errorCounts()}.
clients/src/test/java/org/apache/kafka/common/requests/RequestResponseTest.java