forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssue2369.java
More file actions
29 lines (20 loc) · 780 Bytes
/
Issue2369.java
File metadata and controls
29 lines (20 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package io.jooby;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
public class Issue2369 {
@Test
public void shouldCustomizeServerLostException() {
Throwable cause = new IllegalArgumentException();
Server.addConnectionLost(it -> it == cause);
assertTrue(Server.connectionLost(cause));
assertFalse(Server.connectionLost(new IllegalArgumentException()));
}
@Test
public void shouldCustomizeAddressInUseException() {
Throwable cause = new IllegalArgumentException();
Server.addAddressInUse(it -> it == cause);
assertTrue(Server.isAddressInUse(cause));
assertFalse(Server.isAddressInUse(new IllegalArgumentException()));
}
}