forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssue576.java
More file actions
33 lines (27 loc) · 691 Bytes
/
Copy pathIssue576.java
File metadata and controls
33 lines (27 loc) · 691 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
30
31
32
33
package org.jooby.issues;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.jooby.Err;
import org.jooby.Jooby;
import org.jooby.Status;
import org.junit.Test;
public class Issue576 {
@Test
public void shouldThrowBootstrapException() {
IllegalStateException ies = new IllegalStateException("boot err");
try {
new Jooby() {
{
throwBootstrapException();
onStart(() -> {
throw ies;
});
}
}.start();
fail();
} catch (Err err) {
assertEquals(Status.SERVICE_UNAVAILABLE.value(), err.statusCode());
assertEquals(ies, err.getCause());
}
}
}