Home » Tag Archives: Grails

Tag Archives: Grails

X-Mas Musings – Too Many Paths. One Path Spec?

December is for many people a period of reflection or thought. So I decided to reflect upon last year’s things and thoughts — each day until Christmas. This is day 15. Within a typical (Java) project there a lots of places where some kind of “path” needs to be specified. Gradle For starters, in any build configuration quite a few ...

Read More »

Adding a “lite” Groovy web console to a Grails war

Suppose you have a Grails application deployed to a server – how would you go about finding out how the application was configured? If you have the source then you can view Config.groovy, BuildConfig.groovy, etc. (in this case I’m talking about a Grails 2 app but these ideas are generalizable to Grails 3+) but that’s often not enough. Grails 2 ...

Read More »

Why is Spring’s Health Down, Down, Up, Up, Up and Down again?

Why Our new JavaScript client application regularly calls the /health endpoint of our Grails backend to determine on- of offline state. Things started to become “funny” with it. This endpoint we get for free, since Grails is based on Spring Boot, which comes with a sub-project called Spring Boot Actuator. This gives us a a bunch of endpoints which allows ...

Read More »

Grails 3.3 Integration Testing with Spock Mocks

It is easy to use the Spock Framework, shipped with Grails, to mock or stub a collaborator (such as a service) in our Grails unit tests. The Testing chapter explains a bit about mocking collaborators, doWithSpring/doWithConfig callback methods, the FreshRuntime annotation to mock beans in tests — but they’re mainly for unit testing. How about mocking beans in an integration ...

Read More »

Grails 3.3 has Spock 1.1

You’ll be glad to know that milestone 1 of Grails 3.3 has been released 3 days ago — and is also already available through SDKMAN!. Not only has it upgraded its dependencies to Hibernate 5.1.5, Spring Framework 4.3.7, Spring Boot 1.5.3 and Gradle 3.5, but it also finally ships with the latest Spock 1.1 testing framework. Spock is an old ...

Read More »

Grails Anti-Pattern: Everything is a Service

The context Grails makes it very easy to put any logic of your application in a service. Just grails create-service and you’re good to go. There’s a single instance by default, injectable anywhere. Powerful stuff and makes it easy to get up ‘n running very fast! Creating a new application, following so-called “best practices” from blogs like these and the ...

Read More »

Grails Anti-Pattern: Locally Optimized Dynamic Finders Everywhere

The context Grails makes it very easy to persist and find stuff using domain classes. It uses GORM (Grails’ Object Relational Mapping) under the hood, which by default uses Hibernate to map domain classes to tables in a database. Powerful stuff and makes it easy to get up ‘n running very fast! Creating a new application, following so-called “best practices” ...

Read More »

Debugging Grails 3, Spring Boot or Gradle with Eclipse

This is a small post for those who’s primary IDE is Eclipse for developing Grails 3 apps or plugins — and are still wondering how to debug their application. First of all, to clarify: there’s no “Grails” debugging, it’s just Spring Boot and Gradle these days, with Grails 3. Any way to debug these kind of applications allows you to ...

Read More »