在Kotlin类上选择“创建测试”时,我希望默认包含其他导入。例如,目前仅包含import org.testng.annotations.Test
,但我还想import org.testng.Assert.*
。
如何在IntelliJ中修改Kotlin / TestNG的测试文件模板?
答案 0 :(得分:3)
如果仔细观察,生成的Kotlin测试类实际上首先作为Java类生成,然后快速转换为Kotlin。
因此,您可以修改TestNG Test Class
中的Settings
模板 - > Editor
- > File and Code templates
- > Code
。