Grails

Few tips for writing swift and effective unit test cases

To a beginner writing unit tests may seem to be an overhead and a low productive affair. But this could be due to the way he chooses to write tests. One can quite easily be productive at writing unit test cases as well. Following are a few things that I follow to write the spock unit tests cases in the grails application. I hope these...

by Imran Mir
Tag: spock
05-Jan-2015

Android, Grails

Day 4 at SpringOne 2GX 2014 | The Finale

The final day of SpirngOne 2GX went just like a Mega Finale where they kept best for the last. There were only 3 sessions today, but each one was like one of the best. Here the few highlights of the sessions #  Micro Service Architecture with Spring Boot and Groovy : Marco Vermeulen Beautifully explained the concept of micro...

by Uday Pratap Singh
Tag: spock
12-Sep-2014

Grails

Spock @ConfineMetaClassChanges annotation made writing grails unit test easier

Grails version 2.0 and above made unit testing much simpler with so many new annotations introduced. However if you wanted to mock a specific method of a class whose method is being tested or you wanted to create a stub of the class already annotated by @Mock, things would become difficult. So I always ended up mocking methods via...

by Amit Jain
Tag: spock
10-Jan-2014

Grails

Cool Spock Ignore/IgnoreRest annotations

While writing a test case, we are generally interested in executing only the one we are working on. With JUnit test case in grails we could say "grails test-app <ClassName>.<currentTestCase>".  However it doesn't work with spock specification's. Spock framework provides multiple cool annotations,  following two annotations...

by Amit Jain
Tag: spock
31-Aug-2012

Grails

PageChangeListener for debugging in functional testing using Geb

While using Geb for fuctional testing i require some deugging support so i use PageChangeListener and i found it very useful to find flow of pages while testing my application fuctionally.What it does is it will show the page flow from one page to another.For that we need to just register the PageChangeListener with browser in your ...

by Anuj Aneja
Tag: spock
13-Jan-2011