Building Groovy projects
Let's first implement the QotdService
interface in Groovy. Also, we will write some unit tests to make sure that the functionality works as expected. To start the project, let's create the directory structure as follows:
qotd-groovy βββ build.gradle βββ src βββ main β βββ groovy β β βββ com β β βββ packtpub β β βββ ge β β βββ qotd β β βββ GroovyQotdService.groovy β βββ java β βββ com β βββ packtpub β βββ ge β βββ qotd β βββ QotdService.java βββ test βββ groovy βββ com βββ packtpub βββ ge βββ qotd βββ GroovyQotdServiceTest.groovy
The src/main/java
directory is the default directory for Java sources. Similarly, src/main/groovy
is used by default to compile Groovy source files...