From fbeaa1204ec220543ec1373a2e87ae661c56bd35 Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Thu, 27 Aug 2015 15:27:25 +0200 Subject: [PATCH] SONAR-6693 WS issue_filters/search do no require to be authenticated --- .../org/sonar/server/issue/filter/SearchAction.java | 2 -- .../sonar/server/issue/filter/SearchActionTest.java | 11 +---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/filter/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/filter/SearchAction.java index 8762e28c6fb..e8b39c442e8 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/filter/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/filter/SearchAction.java @@ -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 issueFilters = searchIssueFilters(dbSession); diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/SearchActionTest.java index 3b3a4c7cd04..549411f193b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/SearchActionTest.java @@ -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(); } -- 2.39.5