Search in sources :

Example 11 with Response

use of org.doctester.testbrowser.Response in project ninja by ninjaframework.

the class ApplicationControllerTest method testGet.

@Test
public void testGet() {
    Response response = makeRequest(Request.GET().url(testServerUrl().path("/base/middle/app/get")));
    Assert.assertThat(response.payload, CoreMatchers.equalTo("get works."));
}
Also used : Response(org.doctester.testbrowser.Response) Test(org.junit.Test)

Example 12 with Response

use of org.doctester.testbrowser.Response in project ninja by ninjaframework.

the class ApplicationControllerTest method testProdAndTestMode.

@Test
public void testProdAndTestMode() {
    // Server runs in Test mode. This route is Prod & Test.
    Response response = makeRequest(Request.GET().url(testServerUrl().path("/base/middle/app/mode/prod/and/test")));
    Assert.assertThat(response.payload, CoreMatchers.equalTo("prod and test works."));
}
Also used : Response(org.doctester.testbrowser.Response) Test(org.junit.Test)

Example 13 with Response

use of org.doctester.testbrowser.Response in project ninja by ninjaframework.

the class ApplicationControllerTest method testDevModeIndexMissing.

@Test
public void testDevModeIndexMissing() {
    // Server runs in Test mode making pure "dev" routes unavailable
    Response response = makeRequest(Request.GET().url(testServerUrl().path("/base/middle/app/mode/dev")));
    Assert.assertThat(response.httpStatus, CoreMatchers.equalTo(Result.SC_404_NOT_FOUND));
}
Also used : Response(org.doctester.testbrowser.Response) Test(org.junit.Test)

Example 14 with Response

use of org.doctester.testbrowser.Response in project ninja by ninjaframework.

the class ApplicationControllerTest method testWithoutMethodPath.

@Test
public void testWithoutMethodPath() throws Exception {
    Response response = makeRequest(Request.GET().url(testServerUrl().path("/base/middle/app/")));
    Assert.assertThat(response.payload, CoreMatchers.equalTo("route without method path works."));
}
Also used : Response(org.doctester.testbrowser.Response) Test(org.junit.Test)

Example 15 with Response

use of org.doctester.testbrowser.Response in project ninja by ninjaframework.

the class ApplicationControllerTest method testDelete012.

@Test
public void testDelete012() {
    Response response = makeRequest(Request.DELETE().url(testServerUrl().path("/0/1/2/delete")));
    Assert.assertThat(response.payload, CoreMatchers.equalTo("delete works."));
}
Also used : Response(org.doctester.testbrowser.Response) Test(org.junit.Test)

Aggregations

Response (org.doctester.testbrowser.Response)23 Test (org.junit.Test)23 Message (ninja.utils.Message)2 Article (models.Article)1 ArticleDto (models.ArticleDto)1 ArticlesDto (models.ArticlesDto)1