Spock
Spock is awesome! Seriously Simplified Mocking
@trisha_gee shows in this blog post how Spock simplifies Mocking.
Interesting remark about the use of Spock's @Subject annotation. More about this in the next link.
Indicate Class Under Test with Subject Annotation
Writing good tests is about making them easier to understand once you come back to them weeks after your wrote them. Spock's @Subject annotation is syntactic sugar which helps you remember who is under test. Kudos to @mrhaki
Spock Framework Mock throw exception
Do you need to test how your code behaves if a collaborator raises an exception? Przemysław Wojnowski shows you how to to throw and handle expected exceptions in Spock unit tests.
Grails
Using React with Grails
More and more, Grails is proving itself as a powerful backend choice to empower view technologies other than GSPs. For example, we can use Grails with full-fledged frameworks such as Angular.
Back in May @ZacharyAKlein showed, in the linked blog post, how to create a Gradle project structure which combines a Grails REST API and a view built with React; a javascript library view library.
Such a solution allows front-end developers unfamiliar with Grails to work using their favorite node-based tools and development environments while integrating seamlessly with a Grails Backend. Moreover, he advocates that Grails Developers could have an easy transition from GSP to JSX due to syntax similarities.
Introducing the React Profile for Grails
In the previous link @ZacharyAKlein showed us that using Grails and React is possible. Now he simplifies the process for us with two new profiles: webpack and react
Mix React with your Grails 3 app or separate it completely. You decide.
If you want to use React within your existing Grails application, either to render components on a GSP or to replace some or all of your GSP pages, then use react:1.0.1
If you prefer a completely separate frontend for your Grails application, and/or want to take advantage of the features of the create-react-app CLI, then the react:2.0.1 is made for you.
Comment
G3Summit finished yesterday. I still need time to digest the content. However two announcements came out. First the Grails Application Forge; a Web or API callable service which allows to generate a Grails project by letting you pick features and profiles. It is getting easier to create an app. Second Grails Guides. A initial set of four Guides to get a better knowledge of different parts of the framework. I still need to get deep into those guides.
So, expect more G3 Summit content in the next issue. This issue I talk about React in Grails 3 and sharpen our Spock knowledge.
Groovy Calamari