Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-12989

MockClient should respect the request matcher passed to prepareUnsupportedVersionResponse

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0
    • None
    • None

    Description

      The MockClient offers the possibility to prepare an unsupported version response with MockClient#prepareUnsupportedVersionResponse. That method accepts a RequestMatcher but it is never applied. It should be or we should remove the matcher from the method.

                  UnsupportedVersionException unsupportedVersionException = null;
                  if (futureResp.isUnsupportedRequest) {
                      unsupportedVersionException = new UnsupportedVersionException(
                              "Api " + request.apiKey() + " with version " + version);
                  } else {
                      AbstractRequest abstractRequest = request.requestBuilder().build(version);
                      if (!futureResp.requestMatcher.matches(abstractRequest))
                          throw new IllegalStateException("Request matcher did not match next-in-line request "
                                  + abstractRequest + " with prepared response " + futureResp.responseBody);
                  }
                  ClientResponse resp = new ClientResponse(request.makeHeader(version), request.callback(), request.destination(),
                          request.createdTimeMs(), time.milliseconds(), futureResp.disconnected,
                          unsupportedVersionException, null, futureResp.responseBody);
      

      Attachments

        Activity

          People

            yangpoan PoAn Yang
            dajac David Jacot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: