我需要在 Spring Boot 应用程序中设置系统属性。我不想从命令行设置它。
我关心的是最好的做法是什么。无论是从构造函数还是在 main 方法中。下面是从构造函数设置它的示例
@SpringBootApplication
class Sample{
@Autowired
protected TempInfoDao tempInfoDao;
public Sample{
//Setting System property inside constructor
System.setProperty("vertx.hazelcast.config","./config/cluster.xml");
}
/**
* @param args
*/
public static void main(String[] args) {
SpringApplication.run(Sample.class, args);
}
Run Code Online (Sandbox Code Playgroud)
}
最好的方法是什么?
我想在黄瓜的功能文件中传递类似的东西
Feature: Testing different requests on the XLR CD API
Scenario: Check if the student application can be accessed by users
Scenario Outline: Create a new student & verify if the student is added
When I create a new student by providing the information studentcollege <studentcollege> studentList <studentList>
Then I verify that the student with <student> is created
Examples:
| studentcollege | studentList |
| abcd | [{student_name": "student1","student_id": "1234"},{student_name": "student1","student_id": "1234"}] |
Run Code Online (Sandbox Code Playgroud)
我有课作为
Class Student{
String name;
String id; …Run Code Online (Sandbox Code Playgroud)