简体   繁体   English

使用Spock测试在Java中重命名IntelliJ - 不重命名测试文件

[英]IntelliJ rename in Java with Spock tests - doesn't rename test file

When I refactor Java class name in IntelliJ in project where I have tests in Spock I do not get Spec file renamed at all. 当我在我在Spock中进行测试的项目中的IntelliJ中重构Java类名时,我根本没有重命名Spec文件。 Eg class FilteredRequest with FilteredRequestSpec after refactoring class name, the spec name stays the same. 例如,在重构类名后使用FilteredRequestSpecFilteredRequest ,规范名称保持不变。

Is that possible to make that working? 这有可能使这工作吗?

If it is called FilteredRequestTest then it will be found by IntelliJ when "Rename Tests" is checked in the rename dialog. 如果它被称为FilteredRequestTest那么当在重命名对话框中选中“重命名测试”时,IntelliJ将找到它。

If it is called FilteredRequestSpec , then it won't be found or renamed. 如果它被称为FilteredRequestSpec ,则不会找到或重命名它。

This seems like a bug, as the "Create New Test" dialog finds the FilteredRequestSpec test fine... 这似乎是一个错误,因为“创建新测试”对话框发现FilteredRequestSpec测试正常...

Indeed there is a bug report on the IntelliJ bugtracker which you could vote up 确实有一个关于IntelliJ bugtracker的错误报告你可以投票

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM