]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6693 WS issue_filters/search do no require to be authenticated
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Thu, 27 Aug 2015 13:27:25 +0000 (15:27 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Thu, 27 Aug 2015 13:27:25 +0000 (15:27 +0200)
server/sonar-server/src/main/java/org/sonar/server/issue/filter/SearchAction.java
server/sonar-server/src/test/java/org/sonar/server/issue/filter/SearchActionTest.java

index 8762e28c6fbc67663c593865ac0a3c8d8886b109..e8b39c442e8a7d3605e17049488f224424378281 100644 (file)
@@ -61,8 +61,6 @@ public class SearchAction implements IssueFilterWsAction {
 
   @Override
   public void handle(Request request, Response response) throws Exception {
-    userSession.checkLoggedIn();
-
     DbSession dbSession = dbClient.openSession(false);
     try {
       Set<IssueFilterDto> issueFilters = searchIssueFilters(dbSession);
index 3b3a4c7cd047f2fe0a0156bcaa367a9739b9d33e..549411f193bbb7e7c20aaf4d1d50dfd68f3fb893 100644 (file)
@@ -31,7 +31,6 @@ import org.sonar.db.DbSession;
 import org.sonar.db.DbTester;
 import org.sonar.db.issue.IssueFilterDto;
 import org.sonar.db.issue.IssueFilterFavouriteDto;
-import org.sonar.server.exceptions.UnauthorizedException;
 import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
@@ -60,7 +59,7 @@ public class SearchActionTest {
   public void setUp() {
     dbClient = db.getDbClient();
     dbSession = db.getSession();
-    userSession.login();
+    userSession.anonymous();
 
     ws = new WsActionTester(new SearchAction(dbClient, userSession));
   }
@@ -104,14 +103,6 @@ public class SearchActionTest {
     assertJson(result.getInput()).isSimilarTo(getClass().getResource("SearchActionTest/search.json"));
   }
 
-  @Test
-  public void fail_if_anonymous() throws Exception {
-    userSession.anonymous();
-    expectedException.expect(UnauthorizedException.class);
-
-    newRequest();
-  }
-
   private TestResponse newRequest() {
     return ws.newRequest().execute();
   }