I'm trying to make a test class for a simple client/server, but for some reason it's telling me the symbol does not exist, when it does. I'm using @Before to set up the connection, and then @After to tear it down, but in the @Test it's telling me it can't find the symbol.
@Before
public void setUp() { //this works fine
EchoClient echoClient = new EchoClient();
echoClient.startConnection("127.0.0.1", 4444);
}
@Test
public void givenClient_whenServerEchosMessage_thenCorrect() { // for some reason it can't see echoClient
String resp1 = echoClient.sendMessage("hello"); // even though it's set up in setUp()
String resp2 = echoClient.sendMessage("world");
String resp3 = echoClient.sendMessage("!");
String resp4 = echoClient.sendMessage(".");
assertEquals("hello", resp1);
assertEquals("world", resp2);
assertEquals("!", resp3);
assertEquals("good bye", resp4);
}
@After
public void tearDown()
{
echoClient.stopConnection(); // same issue as in the test method
}
Ignore my horrendous method name