1

I am writing a simple Java test using JUnit and constantly get the following error: Class not found: "md.leonis.ServiceMagi?Test". I don't see any stacktrace.

Recommendations for this ticket did not help: Class Not Found Exception when running JUnit test

I invalidated the InteliJ Idea cache, recompiled the project, with no result. Example class:

public class ServiceMagiсTest {

    @Test
    public void test() {
        assertTrue(true);
    }
}

Who faced this before?

1 Answer 1

0

I figured it out myself. For some mysterious reason, one letter in the class name has been replaced with a similar letter from the Russian alphabet. IDE gave a hint:

Identifier contains symbols from different languages: [LATIN, CYRILLIC]
Non-ASCII characters in an identifier

Hope this helps someone.

1
  • Not just the IDE. The syntax coloring on SO leaves your с black in an otherwise blue classname. Checking for the unicode codepoint value of your character is the first thing that came to mind. Commented Sep 11, 2019 at 13:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.