JUnit configuration with Pattern not matching

Answered

 I want to run all my unit tests. I don't want to run integration tests written by my colleagues. Integration test classes contain the text "IT" , so I am trying the following pattern

^(?!.*IT.*).*$

 

Problem is, it still picks up all the test classes in the entire project:

What am I missing?

P.S. related stackOverflow question:

http://stackoverflow.com/questions/43144469/in-intellij-idea-can-i-run-only-tests-matching-a-regex-pattern

 

1
2 comments

I've verified that this pattern works, see my answer here: http://stackoverflow.com/a/43182331/104891.

Please share the MCVE.

Here is the working project.

0
Avatar
Permanently deleted user

Serge, thank you so much for your prompt answer and for posting the working project.

I verified that pattern matching works fine on your project.

 In the end, one of your colleagues helped me realise it was an issue with JUnit5 and explained that it will be fixed on future versions of IntelliJ (2017.2.X versions).

 

1

Please sign in to leave a comment.