Always Use Parenthesis in Groovy Builders

I recently ran into an interesting Groovy feature when demonstrating the strengths of the MarkupBuilder. As you probably know, parenthesis in a Groovy method call are optional, unless it's a no-args call. In that case the parenthesis are needed in order to distinguish the call from a property. However, leaving out parenthesis in a Builder is asking for trouble. I'll show you why.

Continue Reading Always Use Parenthesis in Groovy Builders

Mocking Classes

Mocking a class rather than an interface might present some interesting obstacles. Perhaps you have ran into the dreaded: Unexpected method call toString(): toString(): expected: 0, actual: 1 You think…

Continue Reading Mocking Classes

End of content

No more pages to load