junit: no tests found

I was getting this error, too:

junit.framework.AssertionFailedError: No tests found in ...

The reason was that I forgot to specify

defaultConfig {
    ...
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

After syncing the project, it found the tests. So maybe it helps someone else.


Extending junit.framework.TestCase is the old JUnit 3 approach of implementing test cases which doesnt work as no methods start with the letters test. Since you're using JUnit 4, just declare the class as

public class EmailProviderTest {

and the test method will be found from the @Test annotation.

Read: JUnit confusion: use 'extend Testcase' or '@Test'?