File tree Expand file tree Collapse file tree 3 files changed +22
-14
lines changed
jooby/src/test/java/com/baeldung/jooby Expand file tree Collapse file tree 3 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 1+ package com .baeldung .jooby ;
2+
3+ import static io .restassured .RestAssured .get ;
4+ import static org .hamcrest .Matchers .equalTo ;
5+
6+ import org .jooby .test .JoobyRule ;
7+ import org .junit .ClassRule ;
8+ import org .junit .Test ;
9+
10+ public class AppLiveTest {
11+
12+ @ ClassRule
13+ public static JoobyRule app = new JoobyRule (new App ());
14+
15+ @ Test
16+ public void given_defaultUrl_expect_fixedString () {
17+ get ("/" ).then ().assertThat ().body (equalTo ("Hello World!" )).statusCode (200 )
18+ .contentType ("text/html;charset=UTF-8" );
19+ }
20+
21+ }
Original file line number Diff line number Diff line change 11package com .baeldung .jooby ;
22
3- import static io .restassured .RestAssured .get ;
4- import static org .hamcrest .Matchers .equalTo ;
53import static org .junit .Assert .assertEquals ;
64
7- import org .jooby .test .JoobyRule ;
85import org .jooby .test .MockRouter ;
9- import org .junit .ClassRule ;
106import org .junit .Test ;
117
128public class AppUnitTest {
139
14- @ ClassRule
15- public static JoobyRule app = new JoobyRule (new App ());
16-
17- @ Test
18- public void given_defaultUrl_expect_fixedString () {
19- get ("/" ).then ().assertThat ().body (equalTo ("Hello World!" )).statusCode (200 )
20- .contentType ("text/html;charset=UTF-8" );
21- }
22-
2310 @ Test
2411 public void given_defaultUrl_with_mockrouter_expect_fixedString () throws Throwable {
2512 String result = new MockRouter (new App ()).get ("/" );
Original file line number Diff line number Diff line change 6262 <plugin >
6363 <groupId >org.apache.maven.plugins</groupId >
6464 <artifactId >maven-surefire-plugin</artifactId >
65- <version >2.20.1</version >
6665 <configuration >
6766 <testFailureIgnore >true</testFailureIgnore >
6867 <excludes >
6968 <exclude >**/*IntegrationTest.java</exclude >
69+ <exclude >**/*LiveTest.java</exclude >
7070 </excludes >
7171 </configuration >
7272 </plugin >
You can’t perform that action at this time.
0 commit comments