Task/bael 10882 fixes2 (#6278)
* BAEL-10882 Fixed failing unit tests * BAEL-10882 Fixed failing unit tests
This commit is contained in:
parent
034869f9c4
commit
6b83fcde01
21
jooby/src/test/java/com/baeldung/jooby/AppLiveTest.java
Normal file
21
jooby/src/test/java/com/baeldung/jooby/AppLiveTest.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package com.baeldung.jooby;
|
||||||
|
|
||||||
|
import static io.restassured.RestAssured.get;
|
||||||
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
|
import org.jooby.test.JoobyRule;
|
||||||
|
import org.junit.ClassRule;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class AppLiveTest {
|
||||||
|
|
||||||
|
@ClassRule
|
||||||
|
public static JoobyRule app = new JoobyRule(new App());
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void given_defaultUrl_expect_fixedString() {
|
||||||
|
get("/").then().assertThat().body(equalTo("Hello World!")).statusCode(200)
|
||||||
|
.contentType("text/html;charset=UTF-8");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,25 +1,12 @@
|
|||||||
package com.baeldung.jooby;
|
package com.baeldung.jooby;
|
||||||
|
|
||||||
import static io.restassured.RestAssured.get;
|
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import org.jooby.test.JoobyRule;
|
|
||||||
import org.jooby.test.MockRouter;
|
import org.jooby.test.MockRouter;
|
||||||
import org.junit.ClassRule;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class AppUnitTest {
|
public class AppUnitTest {
|
||||||
|
|
||||||
@ClassRule
|
|
||||||
public static JoobyRule app = new JoobyRule(new App());
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void given_defaultUrl_expect_fixedString() {
|
|
||||||
get("/").then().assertThat().body(equalTo("Hello World!")).statusCode(200)
|
|
||||||
.contentType("text/html;charset=UTF-8");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void given_defaultUrl_with_mockrouter_expect_fixedString() throws Throwable {
|
public void given_defaultUrl_with_mockrouter_expect_fixedString() throws Throwable {
|
||||||
String result = new MockRouter(new App()).get("/");
|
String result = new MockRouter(new App()).get("/");
|
||||||
|
@ -62,11 +62,11 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>2.20.1</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<testFailureIgnore>true</testFailureIgnore>
|
<testFailureIgnore>true</testFailureIgnore>
|
||||||
<excludes>
|
<excludes>
|
||||||
<exclude>**/*IntegrationTest.java</exclude>
|
<exclude>**/*IntegrationTest.java</exclude>
|
||||||
|
<exclude>**/*LiveTest.java</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user