Package org.sonar.wsclient.issue

Examples of org.sonar.wsclient.issue.IssueClient


            if(userCredentials == null) {
                client = SonarClient.create(serverUrl);
            }else{
                client=SonarClient.builder().url(serverUrl).login(userCredentials.getUsername()).password(PassEncoder.decodeAsString(userCredentials.getPassword())).build();
            }
            IssueClient issueClient = client.issueClient();
            List<RadarIssue> issues=new LinkedList<>();
            Map<String, Rule> rulesCache=new HashMap<>();
            Issues result;
            int pageIndex=1;
            do{
                query.pageIndex(pageIndex);
                result = issueClient.find(query);
                for(Issue issue:result.list()) {
                    Rule rule = rulesCache.get(issue.ruleKey());
                    if(rule == null) {
                        rule=getRule(userCredentials, issue.ruleKey());
                        if(rule == null){
View Full Code Here


  @Test
  public void should_encode_characters() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\"issues\": [{\"key\": \"ABCDE\"}]}");

    IssueClient client = new DefaultIssueClient(requestFactory);
    client.find(IssueQuery.create().issues("ABC DE"));
    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/search?issues=ABC%20DE");

    client.find(IssueQuery.create().issues("ABC+BDE"));
    assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/search?issues=ABC%2BBDE");

    client.find(IssueQuery.create().createdAfter(toDate("2013-01-01")));
    // TODO complete assertion with timestamp when test is isolated from default timezone
    assertThat(httpServer.requestedPath()).startsWith("/api/issues/search?createdAfter=2013-01-01T");
  }
View Full Code Here

TOP

Related Classes of org.sonar.wsclient.issue.IssueClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.