// the find
spring-guides/tut-spring-boot-kotlin
Building web applications with Spring Boot and Kotlin :: Learn how to easily build and test web applications with Spring, Kotlin, Junit and JDBC
Official Spring tutorial showing how to build a simple blog app with Spring Boot and Kotlin. Covers the essential friction points of the Spring+Kotlin combo — the allopen plugin, null safety interop, data classes as entities, Kotlin extensions on Spring types. Aimed at Java/Spring developers moving to Kotlin, not at Kotlin developers new to Spring.
The allopen plugin explanation is genuinely useful and frequently misunderstood — classes are final by default in Kotlin and CGLIB proxies will silently break without it. The null safety section correctly explains how JSpecify annotations translate to Kotlin nullability, which saves a debugging session. Using data classes with Spring Data JDBC (not JPA) sidesteps the open class requirement entirely and is a cleaner pattern than the typical Hibernate approach. The Mockk + SpringMockK setup for @WebMvcTest is the right call — Mockito's Java-centric API is awkward with Kotlin suspend functions and data classes.
It uses Spring Data JDBC with H2, which means you're writing manual SQL schema files and hand-resolving foreign key relationships (the userRepository.findById inside render() call is an N+1 waiting to happen in any real app). The tutorial never addresses coroutines or reactive support, which is where Kotlin's advantage over Java actually shows up in Spring — this reads like a Java tutorial with Kotlin syntax. The EnglishDateFormatter extension in Extensions.kt has a bug: the pattern appends the year twice (yyyy-MM-dd then yyyy again). No mention of the compiler warning you'll hit when using lateinit var with Mockk beans and strict null checks.