private List<String> resolutions;
private Boolean resolved;
private List<String> rules;
- private Boolean sinceLeakPeriod;
private String sort;
private List<String> severities;
private List<String> statuses;
return this;
}
- /**
- * @deprecated since 9.4 - replaced by getInNewCodePeriod()
- */
- @Deprecated(since = "9.4")
- @CheckForNull
- public Boolean getSinceLeakPeriod() {
- return sinceLeakPeriod;
- }
-
- /**
- * @deprecated since 9.4 - replaced by setInNewCodePeriod()
- */
- @Deprecated(since = "9.4")
- public SearchRequest setSinceLeakPeriod(@Nullable Boolean sinceLeakPeriod) {
- this.sinceLeakPeriod = sinceLeakPeriod;
- return this;
- }
-
@CheckForNull
public String getSort() {
return sort;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_AFTER;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_IN_LAST;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_IN_NEW_CODE_PERIOD;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SINCE_LEAK_PERIOD;
/**
* This component is used to create an IssueQuery, in order to transform the component and component roots keys into uuid.
setCreatedAfterFromDates(builder, createdAfter, createdInLast, true);
} else {
// If the filter is on leak period
- checkArgument(createdAfter == null, "Parameters '%s' and '%s' or '%s' cannot be set simultaneously", PARAM_CREATED_AFTER, PARAM_IN_NEW_CODE_PERIOD, PARAM_SINCE_LEAK_PERIOD);
+ checkArgument(createdAfter == null, "Parameters '%s' and '%s' cannot be set simultaneously", PARAM_CREATED_AFTER, PARAM_IN_NEW_CODE_PERIOD);
checkArgument(createdInLast == null,
- format("Parameters '%s' and '%s' or '%s' cannot be set simultaneously", PARAM_CREATED_IN_LAST, PARAM_IN_NEW_CODE_PERIOD, PARAM_SINCE_LEAK_PERIOD));
+ format("Parameters '%s' and '%s' cannot be set simultaneously", PARAM_CREATED_IN_LAST, PARAM_IN_NEW_CODE_PERIOD));
checkArgument(componentUuids.size() == 1, "One and only one component must be provided when searching in new code period");
ComponentDto component = componentUuids.iterator().next();
}
private static boolean notInNewCodePeriod(SearchRequest request) {
- Boolean sinceLeakPeriod = request.getSinceLeakPeriod();
Boolean inNewCodePeriod = request.getInNewCodePeriod();
-
- checkArgument(validPeriodParameterValues(sinceLeakPeriod, inNewCodePeriod),
- "If both provided, the following parameters %s and %s must match.", PARAM_SINCE_LEAK_PERIOD, PARAM_IN_NEW_CODE_PERIOD);
-
- sinceLeakPeriod = Boolean.TRUE.equals(sinceLeakPeriod);
inNewCodePeriod = Boolean.TRUE.equals(inNewCodePeriod);
-
- return !sinceLeakPeriod && !inNewCodePeriod;
- }
-
- private static boolean validPeriodParameterValues(@Nullable Boolean sinceLeakPeriod, @Nullable Boolean inNewCodePeriod) {
- return atMostOneNonNullElement(sinceLeakPeriod, inNewCodePeriod) || !Boolean.logicalXor(sinceLeakPeriod, inNewCodePeriod);
+ return !inNewCodePeriod;
}
private Date findCreatedAfterFromComponentUuid(Optional<SnapshotDto> snapshot) {
assertThat(query.ruleUuids()).containsExactly("non-existing-uuid");
}
- @Test
- public void leak_period_start_date_is_exclusive() {
- long leakPeriodStart = addDays(new Date(), -14).getTime();
-
- ComponentDto project = db.components().insertPublicProject();
- ComponentDto file = db.components().insertComponent(newFileDto(project));
-
- SnapshotDto analysis = db.components().insertSnapshot(project, s -> s.setPeriodDate(leakPeriodStart));
-
- SearchRequest request = new SearchRequest()
- .setComponentUuids(Collections.singletonList(file.uuid()))
- .setOnComponentOnly(true)
- .setSinceLeakPeriod(true);
-
- IssueQuery query = underTest.create(request);
-
- assertThat(query.componentUuids()).containsOnly(file.uuid());
- assertThat(query.createdAfter().date()).isEqualTo(new Date(leakPeriodStart));
- assertThat(query.createdAfter().inclusive()).isFalse();
- assertThat(query.newCodeOnReference()).isNull();
- }
-
@Test
public void in_new_code_period_start_date_is_exclusive() {
long newCodePeriodStart = addDays(new Date(), -14).getTime();
assertThat(query.newCodeOnReference()).isNull();
}
- @Test
- public void leak_period_relies_on_date_for_reference_branch_with_analysis_after_sonarqube_94() {
- long leakPeriodStart = addDays(new Date(), -14).getTime();
-
- ComponentDto project = db.components().insertPublicProject();
- ComponentDto file = db.components().insertComponent(newFileDto(project));
-
- SnapshotDto analysis = db.components().insertSnapshot(project, s -> s.setPeriodMode(REFERENCE_BRANCH.name())
- .setPeriodParam("master"));
-
- MetricDto analysisMetric = db.measures().insertMetric(m -> m.setKey(ANALYSIS_FROM_SONARQUBE_9_4_KEY));
- db.measures().insertLiveMeasure(project, analysisMetric, measure -> measure.setData("true"));
-
- SearchRequest request = new SearchRequest()
- .setComponentUuids(Collections.singletonList(file.uuid()))
- .setOnComponentOnly(true)
- .setSinceLeakPeriod(true);
-
- IssueQuery query = underTest.create(request);
-
- assertThat(query.componentUuids()).containsOnly(file.uuid());
- assertThat(query.newCodeOnReference()).isTrue();
- assertThat(query.createdAfter()).isNull();
- }
@Test
public void new_code_period_does_not_rely_on_date_for_reference_branch_with_analysis_after_sonarqube_94() {
ComponentDto project = db.components().insertPublicProject();
assertThat(result.viewUuids()).containsOnly("<UNKNOWN>");
}
- @Test
- public void application_search_project_issues_on_leak_with_and_without_analysis_after_sonarqube_94() {
- Date now = new Date();
- when(clock.millis()).thenReturn(now.getTime());
- ComponentDto project1 = db.components().insertPublicProject();
- SnapshotDto analysis1 = db.components().insertSnapshot(project1, s -> s.setPeriodDate(addDays(now, -14).getTime()));
- ComponentDto project2 = db.components().insertPublicProject();
- db.components().insertSnapshot(project2, s -> s.setPeriodDate(null));
- ComponentDto project3 = db.components().insertPublicProject();
- ComponentDto project4 = db.components().insertPublicProject();
- SnapshotDto analysis3 =db.components().insertSnapshot(project3,
- s -> s.setPeriodMode(REFERENCE_BRANCH.name()).setPeriodParam("master")
- .setPeriodDate(addDays(now, -14).getTime()));
- db.components().insertSnapshot(project4,
- s -> s.setPeriodMode(REFERENCE_BRANCH.name()).setPeriodParam("master"));
- ComponentDto application = db.components().insertPublicApplication();
- MetricDto analysisMetric = db.measures().insertMetric(m -> m.setKey(ANALYSIS_FROM_SONARQUBE_9_4_KEY));
- db.measures().insertLiveMeasure(project4, analysisMetric, measure -> measure.setData("true"));
- db.components().insertComponents(newProjectCopy("PC1", project1, application));
- db.components().insertComponents(newProjectCopy("PC2", project2, application));
- db.components().insertComponents(newProjectCopy("PC3", project3, application));
- db.components().insertComponents(newProjectCopy("PC4", project4, application));
- userSession.registerApplication(application, project1, project2, project3, project4);
-
- IssueQuery result = underTest.create(new SearchRequest()
- .setComponentUuids(singletonList(application.uuid()))
- .setSinceLeakPeriod(true));
-
- assertThat(result.createdAfterByProjectUuids()).hasSize(2);
- assertThat(result.createdAfterByProjectUuids().entrySet()).extracting(Map.Entry::getKey, e -> e.getValue().date(), e -> e.getValue().inclusive()).containsOnly(
- tuple(project1.uuid(), new Date(analysis1.getPeriodDate()), false),
- tuple(project3.uuid(), new Date(analysis3.getPeriodDate()), false));
- assertThat(result.newCodeOnReferenceByProjectUuids()).hasSize(1);
- assertThat(result.newCodeOnReferenceByProjectUuids()).containsOnly(project4.uuid());
- assertThat(result.viewUuids()).containsExactlyInAnyOrder(application.uuid());
- }
-
@Test
public void application_search_project_issues_in_new_code_with_and_without_analysis_after_sonarqube_94() {
Date now = new Date();
}
- @Test
- public void fail_if_since_leak_period_and_created_after_set_at_the_same_time() {
- assertThatThrownBy(() -> underTest.create(new SearchRequest()
- .setSinceLeakPeriod(true)
- .setCreatedAfter("2013-07-25T07:35:00+0100")))
- .isInstanceOf(IllegalArgumentException.class)
- .hasMessageContaining("Parameters 'createdAfter' and 'inNewCodePeriod' or 'sinceLeakPeriod' cannot be set simultaneously");
- }
-
@Test
public void fail_if_in_new_code_period_and_created_after_set_at_the_same_time() {
SearchRequest searchRequest = new SearchRequest()
assertThatThrownBy(() -> underTest.create(searchRequest))
.isInstanceOf(IllegalArgumentException.class)
- .hasMessageContaining("Parameters 'createdAfter' and 'inNewCodePeriod' or 'sinceLeakPeriod' cannot be set simultaneously");
- }
-
- @Test
- public void fail_if_since_leak_period_and_created_in_last_set_at_the_same_time() {
- SearchRequest searchRequest = new SearchRequest()
- .setSinceLeakPeriod(true)
- .setCreatedInLast("1y2m3w4d");
-
- assertThatThrownBy(() -> underTest.create(searchRequest))
- .isInstanceOf(IllegalArgumentException.class)
- .hasMessageContaining("Parameters 'createdInLast' and 'inNewCodePeriod' or 'sinceLeakPeriod' cannot be set simultaneously");
+ .hasMessageContaining("Parameters 'createdAfter' and 'inNewCodePeriod' cannot be set simultaneously");
}
@Test
assertThatThrownBy(() -> underTest.create(searchRequest))
.isInstanceOf(IllegalArgumentException.class)
- .hasMessageContaining("Parameters 'createdInLast' and 'inNewCodePeriod' or 'sinceLeakPeriod' cannot be set simultaneously");
+ .hasMessageContaining("Parameters 'createdInLast' and 'inNewCodePeriod' cannot be set simultaneously");
}
@Test
.hasMessageContaining("One and only one component must be provided when searching in new code period");
}
- @Test
- public void fail_if_several_components_provided_with_since_leak_period() {
- ComponentDto project1 = db.components().insertPrivateProject();
- ComponentDto project2 = db.components().insertPrivateProject();
-
- assertThatThrownBy(() -> underTest.create(new SearchRequest()
- .setSinceLeakPeriod(true)
- .setComponents(asList(project1.getKey(), project2.getKey()))))
- .isInstanceOf(IllegalArgumentException.class)
- .hasMessageContaining("One and only one component must be provided when searching in new code period");
- }
-
@Test
public void fail_if_several_components_provided_with_in_new_code_period() {
ComponentDto project1 = db.components().insertPrivateProject();
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SANS_TOP_25;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SCOPES;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SEVERITIES;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SINCE_LEAK_PERIOD;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SONARSOURCE_SECURITY;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_STATUSES;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_TAGS;
+ "<br/>When issue indexation is in progress returns 503 service unavailable HTTP code.")
.setSince("3.6")
.setChangelog(
+ new Change("10.0", format("Parameter 'sinceLeakPeriod' is removed, please use '%s' instead", PARAM_IN_NEW_CODE_PERIOD)),
new Change("9.8", "Add message formatting to issue and locations response"),
new Change("9.8", "response fields 'total', 's', 'ps' have been deprecated, please use 'paging' object instead"),
new Change("9.7", "Issues flows in the response may contain a description and a type"),
new Change("9.6", "Response field 'ruleDescriptionContextKey' added"),
new Change("9.6", "New possible value for 'additionalFields' parameter: 'ruleDescriptionContextKey'"),
new Change("9.6", "Facet 'moduleUuids' is dropped."),
- new Change("9.4", format("Parameter '%s' is deprecated, please use '%s' instead", PARAM_SINCE_LEAK_PERIOD, PARAM_IN_NEW_CODE_PERIOD)),
+ new Change("9.4", format("Parameter 'sinceLeakPeriod' is deprecated, please use '%s' instead", PARAM_IN_NEW_CODE_PERIOD)),
new Change("9.2", "Response field 'quickFixAvailable' added"),
new Change("9.1", "Deprecated parameters 'authors', 'facetMode' and 'moduleUuids' were dropped"),
new Change("8.6", "Parameter 'timeZone' added"),
"Accepted units are 'y' for year, 'm' for month, 'w' for week and 'd' for day. " +
"If this parameter is set, createdAfter must not be set")
.setExampleValue("1m2w (1 month 2 weeks)");
- action.createParam(PARAM_SINCE_LEAK_PERIOD)
- .setDescription("To retrieve issues created since the leak period.<br>" +
- "If this parameter is set to a truthy value, createdAfter must not be set and one component uuid or key must be provided.")
- .setDeprecatedSince("9.4")
- .setBooleanPossibleValues();
action.createParam(PARAM_IN_NEW_CODE_PERIOD)
.setDescription("To retrieve issues created in the new code period.<br>" +
"If this parameter is set to a truthy value, createdAfter must not be set and one component uuid or key must be provided.")
.setResolutions(request.paramAsStrings(PARAM_RESOLUTIONS))
.setResolved(request.paramAsBoolean(PARAM_RESOLVED))
.setRules(request.paramAsStrings(PARAM_RULES))
- .setSinceLeakPeriod(request.paramAsBoolean(PARAM_SINCE_LEAK_PERIOD))
.setSort(request.param(Param.SORT))
.setSeverities(request.paramAsStrings(PARAM_SEVERITIES))
.setStatuses(request.paramAsStrings(PARAM_STATUSES))
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_KEYS;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_DIRECTORIES;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_FILES;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_IN_NEW_CODE_PERIOD;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PROJECTS;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PULL_REQUEST;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SINCE_LEAK_PERIOD;
public class SearchActionComponentsTest {
}
@Test
- public void search_since_leak_period_on_project() {
+ public void search_since_in_new_code_period_on_project() {
ComponentDto project = db.components().insertPublicProject(p -> p.setKey("PK1"));
ComponentDto file = db.components().insertComponent(newFileDto(project, null, "F1").setKey("FK1"));
db.components().insertSnapshot(project, a -> a.setPeriodDate(parseDateTime("2015-09-03T00:00:00+0100").getTime()));
ws.newRequest()
.setParam(PARAM_COMPONENT_KEYS, project.getKey())
- .setParam(PARAM_SINCE_LEAK_PERIOD, "true")
+ .setParam(PARAM_IN_NEW_CODE_PERIOD, "true")
.execute()
.assertJson(this.getClass(), "search_since_leak_period.json");
}
}
@Test
- public void search_by_application_and_by_leak() {
+ public void search_by_application_and_by_new_code_period() {
Date now = new Date();
RuleDto rule = db.rules().insertIssueRule();
ComponentDto application = db.components().insertPublicApplication();
SearchWsResponse result = ws.newRequest()
.setParam(PARAM_COMPONENT_KEYS, application.getKey())
- .setParam(PARAM_SINCE_LEAK_PERIOD, "true")
+ .setParam(PARAM_IN_NEW_CODE_PERIOD, "true")
.executeProtobuf(SearchWsResponse.class);
assertThat(result.getIssuesList()).extracting(Issue::getKey)
}
@Test
- public void search_by_application_and_project_and_leak() {
+ public void search_by_application_and_project_and_new_code_period() {
Date now = new Date();
RuleDto rule = db.rules().insertIssueRule();
ComponentDto application = db.components().insertPublicApplication();
SearchWsResponse result = ws.newRequest()
.setParam(PARAM_COMPONENT_KEYS, application.getKey())
.setParam(PARAM_PROJECTS, project1.getKey())
- .setParam(PARAM_SINCE_LEAK_PERIOD, "true")
+ .setParam(PARAM_IN_NEW_CODE_PERIOD, "true")
.executeProtobuf(SearchWsResponse.class);
assertThat(result.getIssuesList()).extracting(Issue::getKey)
}
@Test
- public void search_by_application_and_by_leak_when_one_project_has_no_leak() {
+ public void search_by_application_and_by_new_code_period_when_one_project_has_no_leak() {
Date now = new Date();
RuleDto rule = db.rules().insertIssueRule();
ComponentDto application = db.components().insertPublicApplication();
SearchWsResponse result = ws.newRequest()
.setParam(PARAM_COMPONENT_KEYS, application.getKey())
- .setParam(PARAM_SINCE_LEAK_PERIOD, "true")
+ .setParam(PARAM_IN_NEW_CODE_PERIOD, "true")
.executeProtobuf(SearchWsResponse.class);
assertThat(result.getIssuesList()).extracting(Issue::getKey)
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_IN_NEW_CODE_PERIOD;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PULL_REQUEST;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_RULES;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SINCE_LEAK_PERIOD;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_STATUSES;
public class SearchActionTest {
userSession.logIn(john);
- ws.newRequest()
- .setParam(PARAM_SINCE_LEAK_PERIOD, "true")
- .setParam(PARAM_COMPONENT_KEYS, "PROJECT_KEY")
- .execute()
- .assertJson(this.getClass(), "filter_by_leak_period.json");
-
ws.newRequest()
.setParam(PARAM_IN_NEW_CODE_PERIOD, "true")
.setParam(PARAM_COMPONENT_KEYS, "PROJECT_KEY")
.execute()
.assertJson(this.getClass(), "filter_by_leak_period.json");
- ws.newRequest()
- .setParam(PARAM_IN_NEW_CODE_PERIOD, "true")
- .setParam(PARAM_SINCE_LEAK_PERIOD, "true")
- .setParam(PARAM_COMPONENT_KEYS, "PROJECT_KEY")
- .execute()
- .assertJson(this.getClass(), "filter_by_leak_period.json");
}
@Test
.setParam(PARAM_IN_NEW_CODE_PERIOD, "false")
.execute()
.assertJson(this.getClass(), "default_page_size_is_100.json");
-
- ws.newRequest()
- .setParam(PARAM_SINCE_LEAK_PERIOD, "false")
- .execute()
- .assertJson(this.getClass(), "default_page_size_is_100.json");
-
- ws.newRequest()
- .setParam(PARAM_IN_NEW_CODE_PERIOD, "false")
- .setParam(PARAM_SINCE_LEAK_PERIOD, "false")
- .execute()
- .assertJson(this.getClass(), "default_page_size_is_100.json");
}
@Test
ws.newRequest()
.setParam(PARAM_COMPONENT_KEYS, "PROJECT_KEY")
- .setParam(PARAM_SINCE_LEAK_PERIOD, "true")
- .execute()
- .assertJson(this.getClass(), "empty_result.json");
-
- ws.newRequest()
- .setParam(PARAM_COMPONENT_KEYS, "PROJECT_KEY")
- .setParam(PARAM_IN_NEW_CODE_PERIOD, "true")
- .execute()
- .assertJson(this.getClass(), "empty_result.json");
-
- ws.newRequest()
- .setParam(PARAM_COMPONENT_KEYS, "PROJECT_KEY")
- .setParam(PARAM_SINCE_LEAK_PERIOD, "true")
.setParam(PARAM_IN_NEW_CODE_PERIOD, "true")
.execute()
.assertJson(this.getClass(), "empty_result.json");
ws.newRequest()
.setParam(PARAM_COMPONENT_KEYS, "PROJECT_KEY")
.setParam(PARAM_PULL_REQUEST, "pr")
- .setParam(PARAM_SINCE_LEAK_PERIOD, "true")
- .execute()
- .assertJson(this.getClass(), "filter_by_leak_period_has_no_effect_on_prs.json");
-
- ws.newRequest()
- .setParam(PARAM_COMPONENT_KEYS, "PROJECT_KEY")
- .setParam(PARAM_PULL_REQUEST, "pr")
- .setParam(PARAM_IN_NEW_CODE_PERIOD, "true")
- .execute()
- .assertJson(this.getClass(), "filter_by_leak_period_has_no_effect_on_prs.json");
-
- ws.newRequest()
- .setParam(PARAM_COMPONENT_KEYS, "PROJECT_KEY")
- .setParam(PARAM_PULL_REQUEST, "pr")
- .setParam(PARAM_SINCE_LEAK_PERIOD, "true")
.setParam(PARAM_IN_NEW_CODE_PERIOD, "true")
.execute()
.assertJson(this.getClass(), "filter_by_leak_period_has_no_effect_on_prs.json");
assertThat(def.params()).extracting("key").containsExactlyInAnyOrder(
"additionalFields", "asc", "assigned", "assignees", "author", "componentKeys", "branch", "pullRequest", "createdAfter", "createdAt",
"createdBefore", "createdInLast", "directories", "facets", "files", "issues", "scopes", "languages", "onComponentOnly",
- "p", "projects", "ps", "resolutions", "resolved", "rules", "s", "severities", "sinceLeakPeriod", "statuses", "tags", "types", "pciDss-3.2", "pciDss-4.0", "owaspAsvs-4.0",
+ "p", "projects", "ps", "resolutions", "resolved", "rules", "s", "severities", "statuses", "tags", "types", "pciDss-3.2", "pciDss-4.0", "owaspAsvs-4.0",
"owaspAsvsLevel", "owaspTop10",
"owaspTop10-2021", "sansTop25", "cwe", "sonarsourceSecurity", "timeZone", "inNewCodePeriod");
"This parameter is mostly used by the Issues page, please prefer usage of the componentKeys parameter. If this parameter is set, projectUuids must not be set.");
}
- @Test
- public void fail_when_mismatching_sinceLeakPeriod_and_inNewCodePeriod() {
-
- TestRequest requestLeakTrueNewCodeFalse = ws.newRequest()
- .setParam(PARAM_SINCE_LEAK_PERIOD, "true")
- .setParam(PARAM_IN_NEW_CODE_PERIOD, "false");
-
- assertThatThrownBy(requestLeakTrueNewCodeFalse::execute)
- .isInstanceOf(IllegalArgumentException.class)
- .hasMessage("If both provided, the following parameters sinceLeakPeriod and inNewCodePeriod must match.");
-
- TestRequest requestLeakFalseNewCodeTrue = ws.newRequest()
- .setParam(PARAM_SINCE_LEAK_PERIOD, "false")
- .setParam(PARAM_IN_NEW_CODE_PERIOD, "true");
-
- assertThatThrownBy(requestLeakFalseNewCodeTrue::execute)
- .isInstanceOf(IllegalArgumentException.class)
- .hasMessage("If both provided, the following parameters sinceLeakPeriod and inNewCodePeriod must match.");
- }
-
@Test
public void search_when_additional_field_set_return_context_key() {
insertIssues(issue -> issue.setRuleDescriptionContextKey("spring"));
public static final String PARAM_CREATED_AT = "createdAt";
public static final String PARAM_CREATED_BEFORE = "createdBefore";
public static final String PARAM_CREATED_IN_LAST = "createdInLast";
- @Deprecated
- public static final String PARAM_SINCE_LEAK_PERIOD = "sinceLeakPeriod";
public static final String PARAM_IN_NEW_CODE_PERIOD = "inNewCodePeriod";
public static final String PARAM_ASC = "asc";
public static final String PARAM_ADDITIONAL_FIELDS = "additionalFields";
.setParam("sansTop25", request.getSansTop25() == null ? null : request.getSansTop25().stream().collect(Collectors.joining(",")))
.setParam("sonarsourceSecurity", request.getSonarsourceSecurity() == null ? null : request.getSonarsourceSecurity().stream().collect(Collectors.joining(",")))
.setParam("severities", request.getSeverities() == null ? null : request.getSeverities().stream().collect(Collectors.joining(",")))
- .setParam("sinceLeakPeriod", request.getSinceLeakPeriod())
+ .setParam("inNewCodePeriod", request.isInNewCodePeriod())
.setParam("statuses", request.getStatuses() == null ? null : request.getStatuses().stream().collect(Collectors.joining(",")))
.setParam("tags", request.getTags() == null ? null : request.getTags().stream().collect(Collectors.joining(",")))
.setParam("types", request.getTypes() == null ? null : request.getTypes().stream().collect(Collectors.joining(","))),
private String s;
private List<String> sansTop25;
private List<String> severities;
- private String sinceLeakPeriod;
+ private String inNewCodePeriod;
private List<String> sonarsourceSecurity;
private List<String> statuses;
private List<String> tags;
* <li>"no"</li>
* </ul>
*/
- public SearchRequest setSinceLeakPeriod(String sinceLeakPeriod) {
- this.sinceLeakPeriod = sinceLeakPeriod;
+ public SearchRequest setInNewCodePeriod(String inNewCodePeriod) {
+ this.inNewCodePeriod = inNewCodePeriod;
return this;
}
- public String getSinceLeakPeriod() {
- return sinceLeakPeriod;
+ public String isInNewCodePeriod() {
+ return inNewCodePeriod;
}
/**