diff --git a/src/test/java/de/thm/arsnova/controller/FeedbackControllerTest.java b/src/test/java/de/thm/arsnova/controller/FeedbackControllerTest.java index 6df324b114cfebfabbbf117c5ef327d1c61af2c3..cea87b5a78954bd6ab3222a89f97d195014be638 100644 --- a/src/test/java/de/thm/arsnova/controller/FeedbackControllerTest.java +++ b/src/test/java/de/thm/arsnova/controller/FeedbackControllerTest.java @@ -19,7 +19,6 @@ import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter; import de.thm.arsnova.exceptions.NotFoundException; -import de.thm.arsnova.exceptions.UnauthorizedException; import de.thm.arsnova.services.StubUserService; @RunWith(SpringJUnit4ClassRunner.class) @@ -61,32 +60,4 @@ public class FeedbackControllerTest { assertNull(mav); assertTrue(response.getStatus() == 404); } - - @Test(expected = UnauthorizedException.class) - public void testShouldNotGetFeedbackIfUnauthorized() throws Exception { - userService.setUserAuthenticated(false); - - request.setMethod("GET"); - request.setRequestURI("/session/00000000/feedback"); - final ModelAndView mav = handlerAdapter.handle(request, response, - feedbackController); - - assertNull(mav); - assertTrue(response.getStatus() == 401); - } - - @Test(expected = UnauthorizedException.class) - public void testShouldNotSaveFeedbackIfUnauthorized() throws Exception { - userService.setUserAuthenticated(false); - - request.setMethod("POST"); - request.setRequestURI("/session/00000000/feedback"); - request.setContentType("application/json"); - request.setContent("0".getBytes()); - final ModelAndView mav = handlerAdapter.handle(request, response, - feedbackController); - - assertNull(mav); - assertTrue(response.getStatus() == 401); - } } diff --git a/src/test/java/de/thm/arsnova/services/FeedbackServiceTest.java b/src/test/java/de/thm/arsnova/services/FeedbackServiceTest.java index 1aa1f10d4fb99d435fcab883cb2e6a94fd95e7fe..9088f49c40e72e2d385bca0b7e7a86da4b68c7a3 100644 --- a/src/test/java/de/thm/arsnova/services/FeedbackServiceTest.java +++ b/src/test/java/de/thm/arsnova/services/FeedbackServiceTest.java @@ -18,8 +18,8 @@ */ package de.thm.arsnova.services; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.runner.RunWith; @@ -28,7 +28,6 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import de.thm.arsnova.exceptions.NotFoundException; -import de.thm.arsnova.exceptions.UnauthorizedException; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { @@ -49,12 +48,6 @@ public class FeedbackServiceTest { feedbackService.getFeedback("00000000"); } - @Test(expected = UnauthorizedException.class) - public void testShouldNotReturnFeedbackIfUnauthorized() { - userService.setUserAuthenticated(false); - feedbackService.getFeedback("00000000"); - } - @Test public void testShouldReturnFeedback() { userService.setUserAuthenticated(true); @@ -75,12 +68,6 @@ public class FeedbackServiceTest { feedbackService.getFeedbackCount("00000000"); } - @Test(expected = UnauthorizedException.class) - public void testShouldNotReturnFeedbackCountIfUnauthorized() { - userService.setUserAuthenticated(false); - feedbackService.getFeedbackCount("00000000"); - } - @Test public void testShouldReturnFeedbackCount() { userService.setUserAuthenticated(true); @@ -93,12 +80,6 @@ public class FeedbackServiceTest { feedbackService.getAverageFeedback("00000000"); } - @Test(expected = UnauthorizedException.class) - public void testShouldNotReturnAverageFeedbackIfUnauthorized() { - userService.setUserAuthenticated(false); - feedbackService.getAverageFeedback("00000000"); - } - @Test public void testShouldReturnAverageFeedback() { userService.setUserAuthenticated(true);