Grails unit testing custom codec using Spock -


i'd create spock unit test test custom codec created. of examples see test custom codecs extending grailsunittestcase this. can point me in right direction on how using spock?

i ended doing following:

@testmixin(grailsunittestmixin) class securecodecspec extends specification {     def setup() {         grailsapplication.config.acme.encryption.password = 'topsecret'         mockcodec(securecodec)     }      @unroll     def "securecodec string value #original encodes , decodes properly"() {         when:         def encoded = original.encodeassecure()         def decoded = encoded.decodesecure()          then:         original != encoded         encoded != decoded         original == decoded          where:         original | _         'secret' | _         ''       | _     } 

}


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -