Oh, Christ. You've done something terrible. This enclosed thing was a terrible legacy thing we are moving away from. Also, I didn't necessarily mean for you to switch it to being a java file, just junit. You can write a junit test in groovy.