Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-783

ClientGenerator futurisation for Vert.x 4

    XMLWordPrintable

Details

    • CP: sprint 108, CP: sprint 109
    • 2
    • Core: Platform

    Description

      ClientGenerator.generateMethodMeta generates a

      public void method([other args], Handler<AsyncResult<HttpResponse<Buffer>>> handler) {
      

      method that calls

      request.sendBuffer(buffer, responseHandler);
      

      or

      request.send(responseHandler);
      

      https://github.com/folio-org/raml-module-builder/blob/v32.0.1/domain-models-interface-extensions/src/main/java/org/folio/rest/tools/ClientGenerator.java#L387-L397

      Task:
      Change the method to become

      public Future<HttpResponse<Buffer>> method([other args]) {
      

      that calls

      return request.sendBuffer(buffer);
      

      or

      return request.send();
      

      Wrap the code into a try-catch-clause that returns a failed future with the thrown Throwable.

      Add

      public void method([other args], Handler<AsyncResult<HttpResponse<Buffer>>> handler) {
        method([other args]).onComplete(handler);
      }
      

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                mikhail.fokanov Mikhail Fokanov
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases