@Test public void shouldContainPipelinePauseInfo() throws Exception { pipelinePauseInfo.setPaused(true); pipelinePauseInfo.setPauseCause("pauseCause"); pipelinePauseInfo.setPauseBy("pauseBy"); JsonTester jsonTester = new JsonTester(presenter.toJson()); jsonTester.shouldContain("{ 'paused' : 'true' }"); jsonTester.shouldContain("{ 'pauseCause' : 'pauseCause' }"); jsonTester.shouldContain("{ 'pauseBy' : 'pauseBy' }"); }
@Test public void needsApprovalInJsonShouldBeFalseWhenPipelineIsPaused() throws Exception { pipelinePauseInfo.setPaused(true); JsonTester jsonTester = new JsonTester(presenter.toJson()); jsonTester.shouldContain("{ 'paused' : 'true' }"); jsonTester.shouldNotContain("{ 'needsApproval' : 'true' }"); }
@Before public void setUp() throws Exception { pipelineConfig = PipelineConfigMother.pipelineConfig( "mingle", StageConfigMother.custom("dev", "defaultJob"), StageConfigMother.manualStage("ft")); pipelinePauseInfo = PipelinePauseInfo.notPaused(); presenter = new PipelineHistoryJsonPresentationModel( pipelinePauseInfo, preparePipelineHistoryGroups(pipelineConfig), pipelineConfig, pagination(), CAN_FORCE, hasForceBuildCause, hasModification, true); }
@After public void teardown() throws Exception { pipelinePauseInfo.setPaused(false); }