Task/bael 10882 fixes2 (#6278)

* BAEL-10882 Fixed failing unit tests

* BAEL-10882 Fixed failing unit tests
This commit is contained in:
Dhawal Kapil 2019-02-04 20:27:33 +05:30 committed by Eugen
parent 034869f9c4
commit 6b83fcde01
3 changed files with 22 additions and 14 deletions

View 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");
}
}

View File

@ -1,25 +1,12 @@
package com.baeldung.jooby;
import static io.restassured.RestAssured.get;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import org.jooby.test.JoobyRule;
import org.jooby.test.MockRouter;
import org.junit.ClassRule;
import org.junit.Test;
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
public void given_defaultUrl_with_mockrouter_expect_fixedString() throws Throwable {
String result = new MockRouter(new App()).get("/");

View File

@ -62,11 +62,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LiveTest.java</exclude>
</excludes>
</configuration>
</plugin>