Skip to Main Content
Spring Boot 2.0 Cookbook - Second Edition
book

Spring Boot 2.0 Cookbook - Second Edition

by Alex Antonov
February 2018
Intermediate to advanced content levelIntermediate to advanced
286 pages
7h 20m
English
Packt Publishing
Content preview from Spring Boot 2.0 Cookbook - Second Edition

How to do it...

  1. In order to add the Spock tests to our application, we will need to make a few changes to our build.gradle file first. As Spock tests are written in Groovy, the first thing to do is add a groovy plugin to our build.gradle file, as follows:
apply plugin: 'java' 
apply plugin: 'eclipse' 
apply plugin: 'groovy' 
apply plugin: 'spring-boot' 
  1. We will also need to add the necessary Spock framework dependencies to the build.gradle dependencies block:
dependencies { 
  ... 
  testCompile('org.spockframework:spock-core:1.1-groovy-2.4-rc-2') 
  testCompile('org.spockframework:spock-spring:1.1-groovy-2.4-rc-2') 
  ... 
} 
  1. As the tests will be in Groovy, we will need to create a new source directory for the files. Let's create the src/test/groovy/com/example/bookpub ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Spring 5.0 Cookbook

Spring 5.0 Cookbook

Sherwin John Calleja Tragura
Spring Boot 2.0 Projects

Spring Boot 2.0 Projects

Mohamed Shazin Sadakath
Java Hibernate Cookbook

Java Hibernate Cookbook

Yogesh Prajapati, Vishal Ranapariya

Publisher Resources

ISBN: 9781787129825Supplemental Content