Skip to content

Commit

Permalink
The declared exception IOException is not actually thrown by the method
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jun 6, 2024
1 parent 59a3d8b commit e7f64c9
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;

import java.io.IOException;
import java.net.InetAddress;

import org.junit.jupiter.api.Test;
Expand All @@ -37,15 +36,15 @@ public void testConstructor() {
}

@Test
public void testReceiver() throws IOException {
public void testReceiver() {
try (CharGenUDPClient client = new CharGenUDPClient()) {
// Not connected
assertThrows(NullPointerException.class, client::receive);
}
}

@Test
public void testSend() throws IOException {
public void testSend() {
try (CharGenUDPClient client = new CharGenUDPClient()) {
// Not connected
assertThrows(NullPointerException.class, () -> client.send(InetAddress.getLocalHost()));
Expand Down

0 comments on commit e7f64c9

Please sign in to comment.