Use Synchroniser for all mock tests.

Android Studio tries to collect the output of failed tests on a different thread, which results in an exception when using Mockery's default threading policy, causing the tests to appear as incomplete rather than failed.
This commit is contained in:
akwizgran
2021-11-18 11:32:33 +00:00
parent 1b4ab4f945
commit e91ad962cb
2 changed files with 7 additions and 9 deletions

View File

@@ -1,12 +1,17 @@
package org.briarproject.bramble.test;
import org.jmock.Mockery;
import org.jmock.lib.concurrent.Synchroniser;
import org.junit.After;
public abstract class BrambleMockTestCase extends BrambleTestCase {
protected final Mockery context = new Mockery();
public BrambleMockTestCase() {
context.setThreadingPolicy(new Synchroniser());
}
@After
public void checkExpectations() {
context.assertIsSatisfied();