No need to use @Before to create stateful test objects.

This commit is contained in:
akwizgran
2022-06-20 16:24:55 +01:00
parent 0b93af5d71
commit 05bf3833cf
13 changed files with 34 additions and 97 deletions

View File

@@ -4,7 +4,6 @@ import org.briarproject.bramble.api.plugin.PluginCallback;
import org.briarproject.bramble.api.properties.TransportProperties;
import org.briarproject.bramble.test.BrambleMockTestCase;
import org.jmock.Expectations;
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
@@ -25,12 +24,8 @@ public class ModemPluginTest extends BrambleMockTestCase {
private final PluginCallback callback = context.mock(PluginCallback.class);
private final Modem modem = context.mock(Modem.class);
private ModemPlugin plugin;
@Before
public void setUp() {
plugin = new ModemPlugin(modemFactory, serialPortList, callback, 0);
}
private final ModemPlugin plugin =
new ModemPlugin(modemFactory, serialPortList, callback, 0);
@Test
public void testModemCreation() throws Exception {