This repository was archived by the owner on Jun 9, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +34
-3
lines changed
main/java/se/bjurr/prnfb/settings
test/java/se/bjurr/prnfb/listener Expand file tree Collapse file tree 3 files changed +34
-3
lines changed Original file line number Diff line number Diff line change 33Changelog of Pull Request Notifier for Bitbucket.
44
55## Unreleased
6+ ### GitHub [ #197 ] ( https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/197 ) Button not displaying on PRs which are merged
7+ Trimmin regexp filter and string
8+
9+ [ fcb16d4c700e7d8] ( https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/fcb16d4c700e7d8 ) Tomas Bjerre * 2017-02-17 13:10:58*
10+
11+ ## 2.54
612### GitHub [ #195 ] ( https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/195 ) Merges are not triggering a request?
713 Clarifying 'state' option in notification GUI
814
9- [ 8e84ae0e76aac69 ] ( https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/8e84ae0e76aac69 ) Tomas Bjerre * 2017-02-15 16:31:23 *
15+ [ ba67df63342b90e ] ( https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/ba67df63342b90e ) Tomas Bjerre * 2017-02-15 16:55:43 *
1016
1117### No issue
1218 Building for current and 4.2.0 in Travis
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ public PrnfbNotification(PrnfbNotificationBuilder builder) throws ValidationExce
8484 if (this .triggers .isEmpty ()) {
8585 throw new ValidationException ("triggers" , "At least one trigger must be selected." );
8686 }
87- this .filterString = builder .getFilterString ();
88- this .filterRegexp = builder .getFilterRegexp ();
87+ this .filterString = emptyToNull ( nullToEmpty ( builder .getFilterString ()). trim () );
88+ this .filterRegexp = emptyToNull ( nullToEmpty ( builder .getFilterRegexp ()). trim () );
8989 this .name = firstNonNull (emptyToNull (nullToEmpty (builder .getName ()).trim ()), DEFAULT_NAME );
9090 this .injectionUrl = emptyToNull (nullToEmpty (builder .getInjectionUrl ()).trim ());
9191 this .injectionUrlRegexp = emptyToNull (nullToEmpty (builder .getInjectionUrlRegexp ()).trim ());
Original file line number Diff line number Diff line change @@ -360,6 +360,31 @@ public void testThatNotifiationIsTriggeredByActionIfAFilterIsMatching()
360360 .isTrue ();
361361 }
362362
363+ @ Test
364+ public void testThatNotifiationIsTriggeredByActionIfAFilterIsMatchingWhenTrimmed ()
365+ throws ValidationException {
366+ PrnfbNotification notification =
367+ prnfbNotificationBuilder () //
368+ .withTrigger (RESCOPED_FROM ) //
369+ .withUrl ("http://hej.com" ) //
370+ .withFilterRegexp (" ^abc$ " ) //
371+ .withFilterString (" abc " ) //
372+ .build ();
373+ PrnfbPullRequestAction pullRequestAction = RESCOPED_FROM ;
374+
375+ boolean actual =
376+ sut .isNotificationTriggeredByAction (
377+ notification ,
378+ pullRequestAction ,
379+ renderer ,
380+ pullRequest ,
381+ clientKeyStore ,
382+ shouldAcceptAnyCertificate );
383+
384+ assertThat (actual ) //
385+ .isTrue ();
386+ }
387+
363388 @ Test
364389 public void testThatNotifiationIsTriggeredByActionIfProjectSame () throws ValidationException {
365390 PrnfbNotification notification =
You can’t perform that action at this time.
0 commit comments