@After public void tearDown() { server.stop(); }
@Test public void testWorksWithEphemeralPort() throws IOException { int assignedPort = server.getLocalPort(); Socket socket = new Socket("127.0.0.1", assignedPort); assertTrue(socket.isConnected()); }
@Before public void setUp() { server = new StubServer(0); server.start(); }