Using junit test to pass command line argument to Spring Boot application

前端 未结 7 1536
抹茶落季
抹茶落季 2021-02-12 19:07

I have a very basic Spring Boot application, which is expecting an argument from command line, and without it doesn\'t work. Here is the code.

@SpringBootApplica         


        
7条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-12 20:02

    @SpringBootTest has args param. You can pass cli arguments there

    see https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/test/context/SpringBootTest.html#args--

提交回复
热议问题