Skip to content

Commit

Permalink
GBLD-311: closed Merge Request Events does not trigger job
Browse files Browse the repository at this point in the history
  • Loading branch information
Volodjam committed Jan 27, 2021
1 parent 061e5f0 commit eba02a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
* @author Robin Müller
*/
public enum Action {
open, update, approved, merge, closed, reopen
open, update, approved, merge, close, reopen
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static MergeRequestHookTriggerHandler newMergeRequestHookTriggerHandler(b
.acceptOnlyIf(triggerOnApprovedMergeRequest, null, of(Action.approved))
.acceptIf(triggerOnMergeRequest, of(State.opened, State.reopened), null)
.acceptIf(triggerOnAcceptedMergeRequest, null, of(Action.merge))
.acceptIf(triggerOnClosedMergeRequest, null, of(Action.closed))
.acceptIf(triggerOnClosedMergeRequest, null, of(Action.close))
.acceptIf(triggerOpenMergeRequest != TriggerOpenMergeRequest.never, of(State.updated), null)
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void mergeRequest_build_when_closed() throws IOException, InterruptedExce
MergeRequestHookTriggerHandler mergeRequestHookTriggerHandler = withConfig()
.setTriggerOnClosedMergeRequest(true)
.build();
OneShotEvent buildTriggered = doHandle(mergeRequestHookTriggerHandler, State.closed, Action.closed);
OneShotEvent buildTriggered = doHandle(mergeRequestHookTriggerHandler, State.closed, Action.close);

assertThat(buildTriggered.isSignaled(), is(true));
}
Expand All @@ -144,7 +144,7 @@ public void mergeRequest_build_when_closed_with_actions_enabled() throws IOExcep
.setTriggerOnClosedMergeRequest(true)
.setTriggerOnApprovedMergeRequest(true)
.build();
OneShotEvent buildTriggered = doHandle(mergeRequestHookTriggerHandler, State.closed, Action.closed);
OneShotEvent buildTriggered = doHandle(mergeRequestHookTriggerHandler, State.closed, Action.close);

assertThat(buildTriggered.isSignaled(), is(true));
}
Expand Down

0 comments on commit eba02a7

Please sign in to comment.