Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-10047

Refactor Groovy Tests to Java

    XMLWordPrintableJSON

Details

    • Refactor Groovy Tests to Java
    • To Do

    Description

      A number of component modules include unit tests written in Groovy, while the majority of tests are written in Java. Although Groovy has some advantages for testing in particular, the lack of consistency across the framework presents several maintenance challenges.

      Groovy is similar enough to Java that it is possible to read with minimal effort, but writing idiomatic Groovy requires a greater understanding of the language. Some unit tests have leveraged Groovy to bypass method visibility constraints, which violates standard class and method contracts. Compiling and running tests in Groovy requires additional Maven configuration and plugin execution, which contributes to the overall runtime of continuous integration workflows. Using Java as the standard language for both implementation and tests also makes it easier for contributors to maintain and review changes.

      For these reasons, existing Groovy test classes should be rewritten in Java, with the exception of scripting components.

      Refactoring and rewriting tests should be done in logical groups of work to avoid missing important test functions in the conversion process. Some of the modules with larger numbers of Groovy tests include the following:

      • nifi-toolkit-encrypt-config
      • nifi-toolkit-admin
      • nifi-registry-core
      • nifi-security-utils
      • nifi-elasticsearch-restapi-processors
      • nifi-elasticsearch-client-service
      • nifi-framework-cluster
      • nifi-framework-core
      • nifi-web-api
      • nifi-lookup-services
      • nifi-standard-processors

      Attachments

        Issue Links

          1.
          Refactor Groovy tests in nifi-standard-processors to Java (and JUnit 5) Sub-task Resolved Emilio Setiadarma

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 2.5h
          2.
          Refactor NiFi elasticsearch client service module to no longer use Groovy unit tests Sub-task Resolved Mike Thomsen

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 4h
          3.
          Refactor Groovy tests in nifi-dbcp-service to Java (Junit 5) Sub-task Resolved Emilio Setiadarma

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 20m
          4.
          Refactor Groovy tests in nifi-commons/nifi-utils to Java (and JUnit 5) Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 50m
          5.
          Refactor Groovy tests in nifi-security-utils to Java Sub-task Resolved Emilio Setiadarma

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 10m
          6.
          Refactor Groovy tests in nifi-commons/nifi-expression-language to Java (and JUnit 5) Sub-task Resolved Daniel Stieglitz  
          7.
          Refactor Groovy tests in nifi-commons/nifi-json-utils to Java (and JUnit 5) Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 20m
          8.
          Refactor Groovy tests in nifi-commons/nifi-security-utils-api to Java (and JUnit 5) Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 20m
          9.
          Refactor Groovy tests in nifi-commons/nifi-socket-utils to Java (and JUnit 5) Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 20m
          10.
          Refactor Groovy tests in nifi-commons/nifi-web-utils to Java (and JUnit 5) Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 20m
          11.
          Refactor Groovy tests in nifi-cdc/nifi-cdc-mysql-bundle/nifi-cdc-mysql-processors to Java (and JUnit 5) Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 40m
          12.
          Refactor Groovy tests in nifi-web-api to Java (and JUnit 5) Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 0.5h
          13.
          Refactor Groovy test in nifi-jetty to Java (and JUnit 5) Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 1h 10m
          14.
          Refactor Groovy tests in nifi-web-error and nifi-web-security to Java (and JUnit 5) Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 0.5h
          15.
          Refactor Groovy tests in nifi-elasticsearch-restapi-processors to Java (and JUnit 5) Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 13h 50m
          16.
          Refactor PeerSelectorTest from Groovy to Java Sub-task Resolved Unassigned

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 1.5h
          17.
          Convert Groovy unit tests in nifi-toolkit-tls to Java Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 20m
          18.
          Convert Groovy tests in nifi-scripting-bundle/nifi-scripting-processors to Java Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 1h 20m
          19.
          Refactor Groovy unit test in nifi-mock-record-utils to Java Sub-task Resolved Daniel Stieglitz

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 20m
          20.
          Refactor Groovy Tests in nifi-lookup-services Sub-task Resolved David Handermann

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 40m
          21.
          Remove Groovy Tests using Spock Framework Sub-task Resolved David Handermann

          100%

          Original Estimate - Not Specified Original Estimate - Not Specified
          Time Spent - 0.5h

          Activity

            People

              exceptionfactory David Handermann
              exceptionfactory David Handermann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 30.5h
                  30.5h