1. New Test class. If use idea, shortcut keys can be used to generate alt + insert.
2. Test class plus two notes:
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
Other tests may also be inherited class has two annotations.
3. Add the test method, the name easily play, such as public void test () {}, together with the comment:
@Test
4. bean injection required.