Service Virtualization

Expand all | Collapse all

Groovy script not working in Devtest.

  • 1.  Groovy script not working in Devtest.

    Posted Dec 22, 2016 07:28 AM

    I am using  script assertion . I have written following groovy code . But i am getting following error ,

     

    Assertion name: Scripted Assertion checks for: false is of type: Assert by Script Execution.Script,

     

    def slurper = new groovy.json.JsonSlurper()
    def result = slurper.parseText('{"person":{"name":"Guillaume","age":33,"pets":["dog","cat"]}}')

    assert result.person.name == "Guillaume"
    assert result.person.age == 33
    assert result.person.pets.size() == 2
    assert result.person.pets[0] == "dog"
    assert result.person.pets[1] == "cat"

     

    execution error so we assume false: java.lang.NullPointerException

    Groovy script error

     

    #groovy#assertionscript#scriptlibrary



  • 2.  Re: Groovy script not working in Devtest.
    Best Answer

    Broadcom Employee
    Posted Jan 06, 2017 05:23 PM

    I would open a support case for this.