replaced test codes with groovy script.

now we can use Map literal to code, it makes our test code readable.