Forum Discussion

_ivanovich_'s avatar
Frequent Contributor
5 years ago

How to convert array to intger with groovy ?

Hi, i have a json response where there is a value like :[0].totalValue = [50] if i assert like this: assert[0].totalValue = 50 it doesn't acce...
  • _ivanovich_'s avatar
    5 years ago

    Found solution with this:

    int b = a.collect { "$it" }.join( '' ) as int 

    Sorry for spam.