vendredi 18 septembre 2015

groovy.lang.MissingPropertyException: in groovy

Am new to groovy code. I have a map like this

response = {"data":{"--class":"java.util.HashMap","Enabled":false,"Adult":"[recursive reference removed]","TVMA":"[recursive reference removed]","Locks":[false,false,false,false,false,false],"PINEnabled":false,"AdvisoryLocks":[false,false,false,false,false,false,false,false,false,false,false,false],"safeSearch":"[recursive reference removed]","RatingLocks":[false,false,false,false,false,false]},"success":true}

Using groovy code i want to check the presents of following keys

Enabled, Adult, TVMA, Locks, PINEnabled, AdvisoryLocks, safeSearch, RatingLocks,

I using following code

 for ( data in response.data ) {
            println("-----------------------------------------")       

            assertNotNull(data.Enabled)
            assertNotNull(data.Adult)
            ;;;;;;
            .......
            }
        Am getting groovy.lang.MissingPropertyException: No such property: Enabled

How can i check the presence of above keys from response map using groovy



from Newest questions tagged java - Stack Overflow http://ift.tt/1KV6b2A
via IFTTT

Aucun commentaire:

Enregistrer un commentaire