Micronaut External Config

In one of the previous posts, I described how to have configurations per environment and why it a bad idea to build your jar for every environment. Also we saw how to read configuration values from property sources. Many times you might not be in a position to enumerate your…

Micronaut - A common mistake with the use of @Value

Micronaut provides io.micronaut.context.annotation.Value for injecting value from the property source into a variable. Spring framework also provides a similar annotation. Can you spot the mistake in the below code? package com.nareshak; import io.micronaut.context.annotation.Value; import io.micronaut.http.MediaType; import io.micronaut.…

Micronaut Environment Specific Configuration

In my previous post I described the anti-pattern of rebuilding your artifacts for every environment and explained why it is a bad idea. I also mentioned that modern frameworks support environment specific out of the box. In this post let's see this in action using Micronaut. I will be using…

Upcoming GIDS Talk - Evolving with Java

DetailsI have had the opportunity to work with several developers having a wide range of experience during my coaching engagements. Some of them were happily ignoring the features available in modern versions of the language and busy writing more code and fixing bugs, while others wanted to improve their skills…

Micronaut Service with Groovy & Spock

Micronaut supports Java, Groovy and Kotlin languages. In this post let's explore creating a service using Groovy language and Spock testing framework. If you don't have the Micronaut CLI installed, this post has the details of how to get it installed. 1.1.0 is the latest version of Micronaut…

Groovy Power Assert

When I googled for 'power assert', the first result found was the JavaScript library power assert. The second link contains an interview with the author of this library. He acknowledges the inspirations from Groovy ecosystem. Borrowing good ideas from another language/ ecosystem has had positive influence on many languages. Let's…

Micronaut 1.1 - Improvements in JUnit Tests

Micronaut 1.1.0.RC2 is the latest version as of writing this post. JUnit 5 is now the default test framework for Java projects. Following are the dependencies from the service we created using Micronaut 1.0.5 dependencies { annotationProcessor "io.micronaut:micronaut-inject-java" annotationProcessor "io.micronaut:micronaut-validation" compile "io.…