You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mathieu Lirzin (JIRA)" <ji...@apache.org> on 2018/10/21 13:36:00 UTC

[jira] [Created] (OFBIZ-10611) Allow unit tests to be written in Groovy

Mathieu Lirzin created OFBIZ-10611:
--------------------------------------

             Summary: Allow unit tests to be written in Groovy
                 Key: OFBIZ-10611
                 URL: https://issues.apache.org/jira/browse/OFBIZ-10611
             Project: OFBiz
          Issue Type: Improvement
    Affects Versions: Trunk
            Reporter: Mathieu Lirzin
             Fix For: Upcoming Branch


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:
{code:java}
Map<String, Integer> input = new HashMap<>();
input.put("foo", 42);
input.put("bar", 37);
{code}
can be rewritten in Groovy like this:
{code}
def input = [foo: 42, bar:37]
{code}




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)