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

前端 未结 7 1539
抹茶落季
抹茶落季 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--

    0 讨论(0)
提交回复
热议问题