
We need to configure the Maven dependencies and plugins, i.e. Implementation Creating a projectįirst, we need to create a project (of course, you can also modify on the existing project), the creation of the same way as the pure Java project can be created. Kotlin and Groovy have good compatibility with Spring, and we can use both languages to write test code (this article uses Kotlin). So in this way, we can write test code in a more intuitive and convenient language. In addition to running different code, languages can also call each other because the code is compiled and then has no relation to the higher-level language (we are all bytecode, so why can’t we work together 🤣). For example, Kotlin, Scala, and Groovy can all run on the JVM. So the JVM is not just a program that can run Java.

We know that Java runs on top of the Java Virtual Machine (JVM), which is inherently language-agnostic, and can run on the JVM regardless of the language the upper layer is written in, as long as it can be compiled into a bytecode file. So what can we do to solve these problems? Thinking The biggest headache is the MockMvc mock request test, Java does not support multi-line strings until 15, which leads to the need to splice line by line, which is very unintuitive to read and does not make good use of the Intellij IDEA injection language. But Java is not very efficient in writing test code due to its lengthy code, and we usually consider multiple scenarios when writing the test code, so the amount of code expands dramatically, which brings a lot of time wastage. Usually we write Spring projects using Java language for business development and Java for unit testing.
