@Test
public void actions_with_quality_gate_administer_permission() {
userSession.logIn("john").addPermission(ADMINISTER_QUALITY_GATES, defaultOrganizationProvider.get().getUuid());
- QualityGateDto defaultQualityGate = db.qualityGates().insertQualityGate(qg -> qg.setName("Sonar way").setBuiltIn(true));
+ QualityGateDto defaultQualityGate = db.qualityGates().insertQualityGate(qg -> qg.setName("Default").setBuiltIn(false));
+ QualityGateDto builtInQualityGate = db.qualityGates().insertQualityGate(qg -> qg.setName("Sonar way").setBuiltIn(true));
QualityGateDto otherQualityGate = db.qualityGates().insertQualityGate(qg -> qg.setName("Sonar way - Without Coverage").setBuiltIn(false));
db.qualityGates().setDefaultQualityGate(defaultQualityGate);
.containsExactlyInAnyOrder(true);
assertThat(response.getQualitygatesList())
.extracting(QualityGate::getName,
- qg -> qg.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault(), qp -> qp.getActions().getAssociateProjects())
+ qg -> qg.getActions().getRename(), qg -> qg.getActions().getDelete(), qg -> qg.getActions().getManageConditions(),
+ qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault(), qp -> qp.getActions().getAssociateProjects())
.containsExactlyInAnyOrder(
- tuple(defaultQualityGate.getName(), false, true, false, false),
- tuple(otherQualityGate.getName(), true, true, true, true));
+ tuple(defaultQualityGate.getName(), true, false, true, true, false, false),
+ tuple(builtInQualityGate.getName(), false, false, false, true, true, true),
+ tuple(otherQualityGate.getName(), true, true, true, true, true, true));
}
@Test
.containsExactlyInAnyOrder(false);
assertThat(response.getQualitygatesList())
.extracting(QualityGate::getName,
- qg -> qg.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault(), qp -> qp.getActions().getAssociateProjects())
+ qg -> qg.getActions().getRename(), qg -> qg.getActions().getDelete(), qg -> qg.getActions().getManageConditions(),
+ qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault(), qp -> qp.getActions().getAssociateProjects())
.containsExactlyInAnyOrder(
- tuple(defaultQualityGate.getName(), false, false, false, false),
- tuple(otherQualityGate.getName(), false, false, false, false));
+ tuple(defaultQualityGate.getName(), false, false, false, false, false, false),
+ tuple(otherQualityGate.getName(), false, false, false, false, false, false));
}
@Test
.executeProtobuf(ShowWsResponse.class);
Actions actions = response.getActions();
- assertThat(actions.getEdit()).isTrue();
+ assertThat(actions.getRename()).isTrue();
+ assertThat(actions.getManageConditions()).isTrue();
+ assertThat(actions.getDelete()).isTrue();
assertThat(actions.getCopy()).isTrue();
assertThat(actions.getSetAsDefault()).isTrue();
assertThat(actions.getAssociateProjects()).isTrue();
.executeProtobuf(ShowWsResponse.class);
Actions actions = response.getActions();
- assertThat(actions.getEdit()).isTrue();
+ assertThat(actions.getRename()).isTrue();
+ assertThat(actions.getManageConditions()).isTrue();
+ assertThat(actions.getDelete()).isFalse();
assertThat(actions.getCopy()).isTrue();
assertThat(actions.getSetAsDefault()).isFalse();
assertThat(actions.getAssociateProjects()).isFalse();
.executeProtobuf(ShowWsResponse.class);
Actions actions = response.getActions();
- assertThat(actions.getEdit()).isFalse();
+ assertThat(actions.getRename()).isFalse();
+ assertThat(actions.getManageConditions()).isFalse();
+ assertThat(actions.getDelete()).isFalse();
assertThat(actions.getCopy()).isTrue();
assertThat(actions.getSetAsDefault()).isTrue();
assertThat(actions.getAssociateProjects()).isTrue();
.executeProtobuf(ShowWsResponse.class);
Actions actions = response.getActions();
- assertThat(actions.getEdit()).isFalse();
+ assertThat(actions.getRename()).isFalse();
+ assertThat(actions.getManageConditions()).isFalse();
+ assertThat(actions.getDelete()).isFalse();
assertThat(actions.getCopy()).isFalse();
assertThat(actions.getSetAsDefault()).isFalse();
assertThat(actions.getAssociateProjects()).isFalse();