@Test public void verifyFetchResponseFullWrites() throws Exception { verifyFetchResponseFullWrite(ApiKeys.FETCH.latestVersion(), createFetchResponse(123)); verifyFetchResponseFullWrite(ApiKeys.FETCH.latestVersion(), createFetchResponse(Errors.FETCH_SESSION_ID_NOT_FOUND, 123)); for (short version = 0; version <= ApiKeys.FETCH.latestVersion(); version++) { verifyFetchResponseFullWrite(version, createFetchResponse()); } }
private void checkOlderFetchVersions() throws Exception { int latestVersion = ApiKeys.FETCH.latestVersion(); for (int i = 0; i < latestVersion; ++i) { checkErrorResponse(createFetchRequest(i), new UnknownServerException()); checkRequest(createFetchRequest(i)); checkResponse(createFetchResponse(), i); } }
checkErrorResponse(createControlledShutdownRequest(0), new UnknownServerException()); checkRequest(createFetchRequest(4)); checkResponse(createFetchResponse(), 4); List<TopicPartition> toForgetTopics = new ArrayList<>(); toForgetTopics.add(new TopicPartition("foo", 0)); toForgetTopics.add(new TopicPartition("bar", 0)); checkRequest(createFetchRequest(7, new FetchMetadata(123, 456), toForgetTopics)); checkResponse(createFetchResponse(123), 7); checkResponse(createFetchResponse(Errors.FETCH_SESSION_ID_NOT_FOUND, 123), 7); checkErrorResponse(createFetchRequest(4), new UnknownServerException()); checkRequest(createHeartBeatRequest());