From 6bce4b76d20e7a7102288bdb7e545f763b35dd03 Mon Sep 17 00:00:00 2001 From: akwizgran Date: Thu, 16 Jan 2020 11:05:02 +0000 Subject: [PATCH] Fix test expectations. --- .../bramble/plugin/modem/ModemPluginTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bramble-java/src/test/java/org/briarproject/bramble/plugin/modem/ModemPluginTest.java b/bramble-java/src/test/java/org/briarproject/bramble/plugin/modem/ModemPluginTest.java index df03d3abf..4e3ae0684 100644 --- a/bramble-java/src/test/java/org/briarproject/bramble/plugin/modem/ModemPluginTest.java +++ b/bramble-java/src/test/java/org/briarproject/bramble/plugin/modem/ModemPluginTest.java @@ -9,6 +9,8 @@ import org.junit.Test; import java.io.IOException; +import static org.briarproject.bramble.api.plugin.Plugin.State.ACTIVE; +import static org.briarproject.bramble.api.plugin.Plugin.State.ENABLING; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; @@ -33,6 +35,7 @@ public class ModemPluginTest extends BrambleMockTestCase { @Test public void testModemCreation() throws Exception { context.checking(new Expectations() {{ + oneOf(callback).pluginStateChanged(ENABLING); oneOf(serialPortList).getPortNames(); will(returnValue(new String[] {"foo", "bar", "baz"})); // First call to createModem() returns false @@ -50,6 +53,7 @@ public class ModemPluginTest extends BrambleMockTestCase { will(returnValue(modem)); oneOf(modem).start(); will(returnValue(true)); + oneOf(callback).pluginStateChanged(ACTIVE); }}); plugin.start(); @@ -65,12 +69,14 @@ public class ModemPluginTest extends BrambleMockTestCase { context.checking(new Expectations() {{ // start() + oneOf(callback).pluginStateChanged(ENABLING); oneOf(serialPortList).getPortNames(); will(returnValue(new String[] {"foo"})); oneOf(modemFactory).createModem(plugin, "foo"); will(returnValue(modem)); oneOf(modem).start(); will(returnValue(true)); + oneOf(callback).pluginStateChanged(ACTIVE); // createConnection() oneOf(callback).getLocalProperties(); will(returnValue(local)); @@ -93,12 +99,14 @@ public class ModemPluginTest extends BrambleMockTestCase { context.checking(new Expectations() {{ // start() + oneOf(callback).pluginStateChanged(ENABLING); oneOf(serialPortList).getPortNames(); will(returnValue(new String[] {"foo"})); oneOf(modemFactory).createModem(plugin, "foo"); will(returnValue(modem)); oneOf(modem).start(); will(returnValue(true)); + oneOf(callback).pluginStateChanged(ACTIVE); // createConnection() oneOf(callback).getLocalProperties(); will(returnValue(local)); @@ -121,12 +129,14 @@ public class ModemPluginTest extends BrambleMockTestCase { context.checking(new Expectations() {{ // start() + oneOf(callback).pluginStateChanged(ENABLING); oneOf(serialPortList).getPortNames(); will(returnValue(new String[] {"foo"})); oneOf(modemFactory).createModem(plugin, "foo"); will(returnValue(modem)); oneOf(modem).start(); will(returnValue(true)); + oneOf(callback).pluginStateChanged(ACTIVE); // createConnection() oneOf(callback).getLocalProperties(); will(returnValue(local));