Ratpack Cookbook

Using the same prefix with different HTTP methods in Ratpack

Ratpack is an excellent tool for building RESTful[1] applications. However, to benefit most of it, we need to know the tool a little bit better. It applies to Ratpack handler’s mechanism - it is much different compared to what we have learned by using many popular MVC frameworks. In today’s blog post I would like to show you a relatively simple example that confused many newcomers.

Using the same prefix with different HTTP methods in Ratpack

Ratpack is an excellent tool for building RESTful[1] applications. However, to benefit most of it, we need to know the tool a little bit better. It applies to Ratpack handler’s mechanism - it is much different compared to what we have learned by using many popular MVC frameworks. In today’s blog post I would like to show you a relatively simple example that confused many newcomers.

Ratpack on GraalVM - how to start?

The journey inside the exciting world of GraalVM continues. Today I would like to share with you results of running Ratpack on GraalVM experiment. You are going to learn how to build a native binary of a simple "Hello, World!" Ratpack application. In the end we are going to run some benchmarks to see if running GraalVM executable produces better results than running JAR on a regular Oracle JDK.

Ratpack: register SessionModule in handler unit test

Unit testing Ratpack handlers has many benefits. In the previous post we have learned how to mock Session object to use it with GroovyRequestFixture. Today instead of mocking we will register SessionModule and then we will use a real session object.

Ratpack: mocking Session object in GroovyRequestFixture test

Ratpack allows you unit test handlers using GroovyRequestFixture class. The good thing about this approach is that it does not require running the whole application and you can quickly test if the handler does what you expect. However, if you retrieve objects from Raptack’s registry you will run into a problem - registry in this case is empty.

Related YouTube videos