Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ toggle test not finding tests

In my java project for some reason, even though the class and the test class are located in the same package and the source directory for the tests is specified via the Project Settings -> Modules -> Test Directories, when I did Ctrl+Shift+T it says "No Test Class Found".

I think the reason is because we define everything as an interface, and the classes are all named InterfaceNameImpl and the tests as InterfaceNameContext. So when trying to toggle from InterfaceNameImpl it is looking for InterfaceNameImplTest rather than the correct class.

There is no way that this convention is going to be changed now so is there a way to make IntelliJ work with it?

like image 539
Jamie Cook Avatar asked Apr 23 '26 12:04

Jamie Cook


1 Answers

There is no way that this convention is going to be changed now so is there a way to make IntelliJ work with it?

No, it's hardcoded at the moment. You can submit a request to make it configurable.

like image 116
CrazyCoder Avatar answered Apr 26 '26 08:04

CrazyCoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!