A NoSuchMethodException
occurs because the Robolectric custom JUnit test runner tries to look up a parameter-less test method, test_login()
, instead of the actual test method which does have a parameter.
A workaround is to use mock fields (declared with @Mocked
, @Injectable
, etc. at the test class level) only, avoiding mock parameters.