|
16 | 16 | import org.junit.jupiter.api.BeforeEach; |
17 | 17 | import org.junit.jupiter.api.DisplayName; |
18 | 18 | import org.junit.jupiter.api.Test; |
| 19 | +import org.mockito.InOrder; |
19 | 20 | import org.mockito.MockedStatic; |
20 | 21 | import org.mockito.Mockito; |
21 | 22 |
|
@@ -93,8 +94,11 @@ void testRunApp_MultipleApps_MutedServer_DefaultsTrue() { |
93 | 94 |
|
94 | 95 | // Verification |
95 | 96 | // Defaults was true, so server.setOptions should be called with appOptions |
96 | | - verify(server).setOptions(appOptions); |
97 | | - verify(mutedServer).start(new Jooby[] {app1, app2}); |
| 97 | + InOrder inOrder = inOrder(server, mutedServer); |
| 98 | + inOrder.verify(server).setOptions(appOptions); |
| 99 | + inOrder.verify(server).init(app1); |
| 100 | + inOrder.verify(server).init(app2); |
| 101 | + inOrder.verify(mutedServer).start(new Jooby[] {app1, app2}); |
98 | 102 | } |
99 | 103 |
|
100 | 104 | @Test |
@@ -124,7 +128,9 @@ void testRunApp_SingleApp_NormalServer_DefaultsFalse() { |
124 | 128 |
|
125 | 129 | // Verification |
126 | 130 | verify(server, never()).setOptions(any()); // Because defaults == false |
127 | | - verify(server).start(new Jooby[] {app1}); |
| 131 | + InOrder inOrder = inOrder(server); |
| 132 | + inOrder.verify(server).init(app1); |
| 133 | + inOrder.verify(server).start(new Jooby[] {app1}); |
128 | 134 | } |
129 | 135 |
|
130 | 136 | @DisplayName("Test Exception: StartupException thrown, stop throws ignored exception") |
|
0 commit comments