Looking at the tests – the FirstSpringInitializrApplicationTests class

FirstSpringInitializrApplicationTests contains the basic context that can be used to start writing the tests as we start developing the application:

    package com.mastering.spring;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest
public class FirstSpringInitializrApplicationTests {

@Test
public void contextLoads() {
}
}

The test uses @SpringBootTest, which is used to launch unit tests with Spring Boot Framework. It contains one unit test to check whether the context launches properly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset