Search in sources :

Example 16 with Response

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

the class ApplicationControllerTest method testPut.

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

Example 17 with Response

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

the class ApplicationControllerTest method testPost.

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

Example 18 with Response

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

the class ApplicationControllerTest method testProdMode.

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

Example 19 with Response

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

the class ApplicationControllerTest method testProdMode012.

@Test
public void testProdMode012() {
    // Server runs in Test mode. This route is Prod.
    Response response = makeRequest(Request.GET().url(testServerUrl().path("/0/1/2/mode/prod")));
    Assert.assertThat(response.httpStatus, CoreMatchers.equalTo(Result.SC_404_NOT_FOUND));
}
Also used : Response(org.doctester.testbrowser.Response) Test(org.junit.Test)

Example 20 with Response

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

the class ApplicationControllerTest method testProdAndTestMode012.

@Test
public void testProdAndTestMode012() {
    // Server runs in Test mode. This route is Prod & Test.
    Response response = makeRequest(Request.GET().url(testServerUrl().path("/0/1/2/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)

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