BAEL-3464 - Ninja framework

This commit is contained in:
Anshul BANSAL
2019-12-14 16:34:34 +02:00
parent 29657eb081
commit 7daa791c2b
14 changed files with 114 additions and 115 deletions

View File

@@ -2,37 +2,26 @@ package controllers;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;
import javax.inject.Inject;
import org.doctester.testbrowser.Request;
import org.doctester.testbrowser.Response;
import org.junit.Test;
import org.mockito.Mock;
import ninja.NinjaDocTester;
import services.UserService;
public class ApiControllerDocTesterTest extends NinjaDocTester {
String URL_INDEX = "/";
String URL_HELLO = "/hello";
String URL_USER_JSON = "/userJson";
String URL_USERS = "/users";
@Mock
UserService userService;
@Test
public void testGetIndex() {
Response response = makeRequest(Request.GET().url(testServerUrl().path(URL_INDEX)));
assertThat(response.payload, containsString("Bonjour, bienvenue dans Ninja Framework!"));
assertThat(response.payload, containsString("Hello, welcome to Ninja Framework!"));
}
@Test
public void testGetHello() {
Response response = makeRequest(Request.GET().url(testServerUrl().path(URL_HELLO)));
assertThat(response.payload, containsString("Hello, welcome to Ninja Framework!"));
assertThat(response.payload, containsString("Bonjour, bienvenue dans Ninja Framework!"));
}
}