Adding ratpack module (#1374)

* adding ratpack module

* adding pom.xml
This commit is contained in:
Abhinab Kanrar
2017-03-12 15:19:13 +05:30
committed by maibin
parent dda35bc510
commit 2f3f490453
4 changed files with 121 additions and 0 deletions
@@ -0,0 +1,31 @@
package com.baeldung;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import ratpack.test.MainClassApplicationUnderTest;
import static org.junit.Assert.assertEquals;
@RunWith(JUnit4.class)
public class ApplicationTest {
MainClassApplicationUnderTest appUnderTest = new MainClassApplicationUnderTest(Application.class);
@Test
public void givenDefaultUrl_getStaticText() {
assertEquals("Welcome to baeldung ratpack!!!", appUnderTest.getHttpClient().getText("/"));
}
@Test
public void givenDynamicUrl_getDynamicText() {
assertEquals("Hello dummybot!!!", appUnderTest.getHttpClient().getText("/dummybot"));
}
@After
public void shutdown() {
appUnderTest.close();
}
}