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;
public void setUp() {
dbClient = db.getDbClient();
dbSession = db.getSession();
- userSession.login();
+ userSession.anonymous();
ws = new WsActionTester(new SearchAction(dbClient, userSession));
}
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();
}