Groovy
Getting Information About Objects
Groovy inspect() method will try to return a String which matches closest what we would type in Groovy code to create the object.
Spock
JUnit vs Spock + Spock Cheatsheet
After an introduction about why Junit does not work for him and how Spock addresses those shortcomings, @Jakub_Dziworski provides a bookmark-worthy Spock Cheatsheet.
Stubbing and Mocking in Java with the Spock Testing Framework
Mock and Stubs is one area where Spock shines.
In this post, @codepipes covers:
- How to download and set up Spock via Maven,
- The advantages Spock brings when it comes to testing Java code
- Basic stubbing with the >> operator,
- Basic verification with the N * mockedObject.method(arguments) syntax,
- Advanced verification of arguments using Groovy closure and the underscore character,
- Advanced dynamic manipulation of arguments, and
- Advanced dynamic responses based on arguments.
Grails
Grails + @Scheduled
When you use Grails, you can use every Spring Boot capability. Learn how to use Spring Task Execution and Scheduling to schedule periodic tasks inside your Grails application with this Grails Guide.
Grails + Schwartz
My personal favourite plugin to schedule tasks in a Grails application. This Grails Guide shows how to use Schwartz plugin to schedule/manage Jobs in your Grails apps.
GORM Event Listeners
Starting with Grais 3.2.8 autowiring of GORM entities is disabled. Injection of services in domain classes was often used in combination of beforeInsert
, beforeUpdate
methods. etc.
In this Grails guide, you learn how to react to GORM events synchronously and asynchronously without the need of responding to those events inside your domain classes. No excuse to inject services in your domain classes 🚫.
Comment
By February end, Greach's early bird tickets expire. I explore how to schedule jobs in a Grails app in this issue so that we do not forget to purchase it ⏰.
There are a couple of nice Spock posts in this issue too. Enjoy!
Sergio del Amo