コード例 #1
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"));
  }
コード例 #2
0
 @Test
 public void shouldHaveGroupsInJson() throws Exception {
   fixture.createPipelineWithFirstStagePassedAndSecondStageHasNotStarted();
   JsonMap jsonMap = requestPipelineHistoryPage();
   JsonList groups = jsonMap.getJsonList("groups");
   assertThat(groups.size(), is(1));
 }
コード例 #3
0
 @After
 public void teardown() throws Exception {
   dbHelper.onTearDown();
   fixture.onTearDown();
   configHelper.onTearDown();
   resetSecurityContext();
 }
コード例 #4
0
 @Test
 public void hasModificationShouldBeTrueIfThereIsBuildCauseInBuffer() throws Exception {
   fixture.createNewCheckin();
   scheduleHelper.autoSchedulePipelinesWithRealMaterials(fixture.pipelineName);
   JsonMap jsonMap = requestPipelineHistoryPage();
   assertThat(getItemInJson(jsonMap, "showForceBuildButton"), is("true"));
 }
コード例 #5
0
 @Test
 public void shouldCreateGroupIfPipelineHasModificationEvenNoPipelineHistory() throws Exception {
   fixture.createNewCheckin();
   scheduleHelper.autoSchedulePipelinesWithRealMaterials(fixture.pipelineName);
   JsonMap jsonMap = requestPipelineHistoryPage();
   JsonList groups = jsonMap.getJsonList("groups");
   assertThat("Should create group for the coming pipeline", groups.size(), is(1));
 }
コード例 #6
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"));
  }
コード例 #7
0
  @Before
  public void setUp() throws Exception {
    fixture = new PipelineWithMultipleStages(3, materialRepository, transactionTemplate);
    configHelper.usingCruiseConfigDao(goConfigFileDao);
    configHelper.onSetUp();

    dbHelper.onSetUp();
    fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
    goConfigService.forceNotifyListeners();
    request = new MockHttpServletRequest();
    response = new MockHttpServletResponse();
  }