Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-10611

Allow unit tests to be written in Groovy

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Implemented
    • Affects Version/s: Trunk
    • Fix Version/s: Upcoming Branch
    • Component/s: None
    • Labels:
      None

      Description

      Since OFBIZ-9996 it is possible to write integration tests in Groovy, meaning test that depend on the dispatcher and the delegator. It would be nice if the unit tests could be written in Groovy too.

      The major benefit of writing tests in Groovy is that you create inputs and expected outputs more easily with objects literals. For example the following java code:

      Map<String, Integer> input = new HashMap<>();
      input.put("foo", 42);
      input.put("bar", 37);
      

      can be rewritten in Groovy like this:

      def input = [foo: 42, bar: 37]
      

        Attachments

          Activity

            People

            • Assignee:
              jacques.le.roux Jacques Le Roux
              Reporter:
              mthl Mathieu Lirzin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: