forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJoobyRuleTest.java
More file actions
36 lines (32 loc) · 917 Bytes
/
JoobyRuleTest.java
File metadata and controls
36 lines (32 loc) · 917 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
34
35
36
package org.jooby.test;
import org.jooby.Jooby;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
@RunWith(PowerMockRunner.class)
@PrepareForTest({JoobyRule.class, Jooby.class })
public class JoobyRuleTest {
@Test
public void before() throws Exception {
new MockUnit(Jooby.class)
.expect(unit -> {
Jooby app = unit.get(Jooby.class);
app.start("server.join=false");
})
.run(unit -> {
new JoobyRule(unit.get(Jooby.class)).before();
});
}
@Test
public void after() throws Exception {
new MockUnit(Jooby.class)
.expect(unit -> {
Jooby app = unit.get(Jooby.class);
app.stop();
})
.run(unit -> {
new JoobyRule(unit.get(Jooby.class)).after();
});
}
}