dimanche 18 mars 2018

How to test main method in Spring Boot Application

When I create Spring Boot Application it generates 2 classes:

@SpringBootApplication
public class App {

    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }
}

And the second on is test:

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

    @Test
    public void contextLoads() {
    }

}

Like you can notice contextLoads test is empty. How should I provide correct test for contextLoad? It should stay empty maybe? Is it correct? Or I should put something inside?

I readed answers like this but it didn't gave me a clear answer.

Aucun commentaire:

Enregistrer un commentaire