BAEL-2513

This commit is contained in:
Krzysztof Majewski
2019-10-30 13:51:17 +01:00
parent db85c8f275
commit 3453b7a18b
20537 changed files with 1642833 additions and 0 deletions
@@ -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");
}
}
@@ -0,0 +1,16 @@
package com.baeldung.jooby;
import static org.junit.Assert.assertEquals;
import org.jooby.test.MockRouter;
import org.junit.Test;
public class AppUnitTest {
@Test
public void given_defaultUrl_with_mockrouter_expect_fixedString() throws Throwable {
String result = new MockRouter(new App()).get("/");
assertEquals("Hello World!", result);
}
}