How to test main class of Spring-boot application

后端 未结 9 1886
心在旅途
心在旅途 2020-12-03 00:18

I have a spring-boot application where my @SpringBootApplication starter class looks like a standard one. So I created many tests for all my functi

9条回答
  •  感情败类
    2020-12-03 01:00

    You can do something like this

    @Test
    public void applicationContextLoaded() {
    }
    
    @Test
    public void applicationContextTest() {
        mainApp.main(new String[] {});
    }
    

提交回复
热议问题