In Chapter 2, Vue.js 2 – It Works in the Way You Expected, we created a Messages App that has an API to retrieve all of the messages that are received. In this section, we will write unit testing code in that application to test that API.
Before writing any test code, we need to add spring-boot-starter-test in the Message App's pom.xml file, as shown in the following code. Let's have a look at the pom.xml file:
<project> ... <dependencies> ... <!-- Test --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> ...</project>
For this dependency, we use a test scope so that the related dependencies won't be ...