java.lang.RuntimeException: java.lang.NoSuchMethodException: com.xxxx.xxxx.app.ReceivedMsgNotificationHelperTestJmockit.testIsBaseBusinessMessage_hiddenChat()
at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:236) at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:89) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)Caused by: java.lang.NoSuchMethodException: com.xxxx.xxxx.app.ReceivedMsgNotificationHelperTestJmockit.testIsBaseBusinessMessage_hiddenChat() at java.lang.Class.getMethod(Class.java:1786) at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:234) ... 5 more
OS: Mac OS
JAVA: JDK 1.8.261
JMockit: 1.49
Robolectric: 4.3.1
Junit: 4.13
@RunWith(RobolectricTestRunner.class)
public class ReceivedMsgNotificationHelperTestJmockit {
@Mocked
MessageMocker messageMocker;
public static class AppInterfaceMockUp extends MockUp<AppInterface> {
@Mock
public void $init(BaseApplicationImpl baseApplication, String processname) {}
@Mock
public void $clinit() {}
}
@Test
public void testIsBaseBusinessMessage_hiddenChat(@Injectable BaseApplicationImpl baseApplication) throws Exception {
final Message message = messageMocker.simpleMessage();
new AppInterfaceMockUp();
final AppInterface app = new AppInterface(baseApplication, "processname");
new Expectations(){
{
HiddenChatHelper.isHiddenChat(message.frienduin, message.istroop, app);
result = true;
}
};
boolean res = HiddenChatHelper.isHiddenChat(message.frienduin, message.istroop, app);
Assert.assertTrue(res);
}
}