2019-12-08 14:40:42 +02:00
|
|
|
package controllers;
|
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
|
import javax.inject.Inject;
|
|
|
|
|
import org.junit.Before;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
|
import ninja.NinjaRunner;
|
|
|
|
|
import ninja.Result;
|
|
|
|
|
import services.UserService;
|
|
|
|
|
|
|
|
|
|
@RunWith(NinjaRunner.class)
|
2023-01-16 10:26:20 +02:00
|
|
|
public class ApiControllerMockIntegrationTest {
|
2019-12-08 14:40:42 +02:00
|
|
|
|
|
|
|
|
@Inject private UserService userService;
|
|
|
|
|
|
|
|
|
|
ApplicationController applicationController;
|
|
|
|
|
|
|
|
|
|
@Before
|
|
|
|
|
public void setupTest() {
|
|
|
|
|
applicationController = new ApplicationController();
|
|
|
|
|
applicationController.userService = userService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testThatGetUserJson() {
|
|
|
|
|
Result result = applicationController.userJson();
|
|
|
|
|
System.out.println(result.getRenderable());
|
2019-12-14 16:34:34 +02:00
|
|
|
assertEquals(userService.getUserMap().toString(), result.getRenderable().toString());
|
2019-12-08 14:40:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|