My experience with Java, Groovy, Grails, Python and more.
  • Home

groovy

A collection of 9 posts

micronaut

How to Micronaut with Kotlin and Java with Groovy tests

Recently, I came across Micronaut framework. It's a super light framework that fills the need for something in between Spring Boot and Vert.x. I have been playing with it and wanted to

  • Ravi Hasija
    Ravi Hasija
4 min read
groovy

Groovy Unmarshalling Json to a specific Object

If you have a simple POJO (Plain Old Java Object) or POGO (Plain Old Groovy Object), you can use Groovy's default Map based constructor to convert the JSON string to an Object type.

  • Ravi Hasija
    Ravi Hasija
1 min read
groovy

Custom validation message in Grails

Grails[1] is an awesome full stack, web application framework on JVM. It has good documentation but not excellent documentation. I am working on a business project where I am using Grails REST

  • Ravi Hasija
    Ravi Hasija
3 min read
groovy

Store current date time in Mongo in ISO format

I wanted to store current date time (in UTC time zone) in ISO format in Mongo with Groovy as the language. It is pretty straightforward with joda time library. First the code and

  • Ravi Hasija
    Ravi Hasija
1 min read
groovy

Retry with Spring - I

Spring batch provides an excellent paradigm to retry an operation in case the operation might succeed eventually. It offers couple retry strategies: a. Retry a certain number of times. (Covered below) b. Retry

  • Ravi Hasija
    Ravi Hasija
3 min read
groovy

Throw dynamic exceptions in Spock tests from where block

It's pretty straightforward due to Groovy awesomeness! Without any further ado: import spock.lang.Specification /** * Created by ravi on 11/14/14. */ class SpockDynamicExceptionTest extends Specification { def "test 1234"() { given: def

  • Ravi Hasija
    Ravi Hasija
1 min read
groovy

Groovy vs Java file I/O comparison, and how to improve it using withWriter.

I learnt by making a mistake and hope to help someone with this post. This weekend I tried to compare Java file I/O with Groovy on two fronts: a. Code bevity. b.

  • Ravi Hasija
    Ravi Hasija
1 min read
groovy

NFJS Experience - What I gained from it (Part I)

I had the opportunity to be at NFJS from Jul 22-24 sponsored by Griffin Solutions Group. It was my first experience and an experience that is difficult to describe in words. There were

  • Ravi Hasija
    Ravi Hasija
2 min read
groovy

Implementing AOP in Grails Services via Groovy's GroovyInterceptable interface

Groovy provides Aspect Oriented Programming construct via GroovyInterceptable interface. The concept is as simple as implementing GroovyInterceptable interface and providing a definition for Object invokeMethod(String name, Object args) method as shown below.

  • Ravi Hasija
    Ravi Hasija
1 min read
My experience with Java, Groovy, Grails, Python and more. © 2025
Latest Posts Ghost