コード例 #1
0
  @Test
  public void canPauseShouldBeFalseForUnauthorizedAccess() throws Exception {
    configHelper.addSecurityWithAdminConfig();
    configHelper.setOperatePermissionForGroup("defaultGroup", "jez");

    JsonMap jsonMap = requestPipelineHistoryPage();
    assertThat(getItemInJson(jsonMap, "canPause"), is("false"));
  }
コード例 #2
0
  @Test
  public void canPauseShouldBeTrueForAuthorizedAccess() throws Exception {
    configHelper.addSecurityWithAdminConfig();
    configHelper.setOperatePermissionForGroup(
        "defaultGroup", CaseInsensitiveString.str(Username.ANONYMOUS.getUsername()));

    JsonMap jsonMap = requestPipelineHistoryPage();
    assertThat(getItemInJson(jsonMap, "canPause"), is("true"));
  }
コード例 #3
0
  @Test
  public void canForceShouldBeTrueForAuthorizedUser() throws Exception {
    configHelper.addSecurityWithAdminConfig();
    fixture.configStageAsManualApprovalWithApprovedUsers(fixture.devStage, "userA");

    login("userA", "");
    JsonMap jsonMap = requestPipelineHistoryPage();
    assertThat(getItemInJson(jsonMap, "canForce"), is("true"));
  }
コード例 #4
0
  @Test
  public void canForceShouldBeFalseForUnauthorizedAccess() throws Exception {
    configHelper.addSecurityWithAdminConfig();
    fixture.configStageAsManualApprovalWithApprovedUsers(fixture.devStage, "user");

    fixture.createPipelineWithFirstStagePassedAndSecondStageHasNotStarted();

    JsonMap jsonMap = requestPipelineHistoryPage();
    assertThat(getItemInJson(jsonMap, "canForce"), is("false"));
  }