tuple(qualityGate3.getName(), OVER_COMPLIANT.toString()));
}
- @Test
- public void test_deprecated_default_field() {
- QualityGateDto defaultQualityGate = db.qualityGates().insertQualityGate();
- db.qualityGates().setDefaultQualityGate(defaultQualityGate);
-
- ListWsResponse response = ws.newRequest()
- .executeProtobuf(ListWsResponse.class);
-
- assertThat(response.getDefault()).isEqualTo(defaultQualityGate.getUuid());
- }
-
@Test
public void no_default_quality_gate() {
QualityGateDto qualityGate = db.qualityGates().insertQualityGate();
import org.sonarqube.ws.Qualitygates.ListWsResponse;
import org.sonarqube.ws.Qualitygates.ListWsResponse.QualityGate;
-import static java.util.Optional.ofNullable;
import static org.sonar.core.util.stream.MoreCollectors.toList;
import static org.sonar.server.ws.WsUtils.writeProtobuf;
.setSince("4.3")
.setResponseExample(Resources.getResource(this.getClass(), "list-example.json"))
.setChangelog(
+ new Change("10.0", "Field 'default' in the response has been removed"),
new Change("10.0", "Field 'id' in the response has been removed"),
new Change("9.9", "'caycStatus' field is added on quality gate"),
new Change("8.4", "Field 'id' in the response is deprecated. Format changes from integer to string."),
.setActions(wsSupport.getActions(dbSession, qualityGate, defaultQualityGate))
.build())
.collect(toList()));
- ofNullable(defaultUuid).ifPresent(builder::setDefault);
return builder.build();
}
// GET api/qualitygates/list
message ListWsResponse {
repeated QualityGate qualitygates = 1;
- // Deprecated since 7.0
- optional string default = 2;
+ reserved 2; //drop default
optional RootActions actions = 3;
message QualityGate {