Skip to content
Snippets Groups Projects
Commit 96051ad5 authored by Paul-Christian Volkmer's avatar Paul-Christian Volkmer
Browse files

Added test to check if feedback will be returned as expected

parent 470259f9
No related merge requests found
...@@ -85,4 +85,16 @@ public class FeedbackControllerTest { ...@@ -85,4 +85,16 @@ public class FeedbackControllerTest {
assertTrue(response.getStatus() == 200); assertTrue(response.getStatus() == 200);
assertEquals("0", response.getContentAsString()); assertEquals("0", response.getContentAsString());
} }
@Test
public void testShouldReturnFeedback() throws Exception {
userService.setUserAuthenticated(true);
request.setMethod("GET");
request.setRequestURI("/session/87654321/feedback");
handlerAdapter.handle(request, response, feedbackController);
assertTrue(response.getStatus() == 200);
assertEquals("{\"values\":[2,3,5,7]}", response.getContentAsString());
}
} }
...@@ -27,7 +27,8 @@ import de.thm.arsnova.services.StubUserService; ...@@ -27,7 +27,8 @@ import de.thm.arsnova.services.StubUserService;
@ContextConfiguration(locations = { @ContextConfiguration(locations = {
"file:src/main/webapp/WEB-INF/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/arsnova-servlet.xml",
"file:src/main/webapp/WEB-INF/spring/spring-main.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml",
"file:src/test/resources/test-config.xml" }) "file:src/test/resources/test-config.xml"
})
public class SessionControllerTest { public class SessionControllerTest {
@Inject @Inject
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment