Make sure your class is declared as public and not ‘default’
public class MyClassTest
as opposed to:
class MyClassTest
When creating a new test class via IntelliJ shortcut the generated class was not declared as public and that caused the error.