Skip to content

[MENFORCER-314] - Warn if EnforcerRuleException has no message#43

Closed
famod wants to merge 1 commit intoapache:masterfrom
famod:MENFORCER-314
Closed

[MENFORCER-314] - Warn if EnforcerRuleException has no message#43
famod wants to merge 1 commit intoapache:masterfrom
famod:MENFORCER-314

Conversation

@famod
Copy link
Contributor

@famod famod commented Oct 27, 2018

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MENFORCER-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MENFORCER-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@famod
Copy link
Contributor Author

famod commented Oct 27, 2018

I pushed an alternative approach because I couldn't really decide which one is better: #44

Please merge whichever PR you like best. I'd probably go with #44.

@eolivelli
Copy link
Contributor

@famod I prefer this one.
Can you add a simple integration test ? This way in the future we would not add regressions.

I will be happy to merge as soon as we have the test.

cc @khmarbaise

@famod
Copy link
Contributor Author

famod commented Jan 31, 2019

@eolivelli I had a quick look at the existing integration tests and I have to say that I have no clue how to test this very specific (and rare) case with capabilities of maven-invoker-plugin.
I mean, I would need to provoke a NPE or similar in a existing rule. How would one do that?

Extending TestEnforceMojo seems more doable, IMHO.

This should help to find out why DependencyConvergence
sometimes fails without providing a message.
@famod
Copy link
Contributor Author

famod commented Feb 1, 2019

I jumped ahead and extended TestEnforceMojo. IMHO this should be sufficient for such a small change.

Please note that I won't be able to put much more effort into this entire issue as I am busy elsewhere.

PS: Yes, I did see that there is a custom MockEnforcerRule but I saw no real sense in extending this with more logic as mockito is just way more flexible at such tasks (and you need to write less code).

@eolivelli
Copy link
Contributor

@famod great work.

Will commit soon

@eolivelli
Copy link
Contributor

@eolivelli
Copy link
Contributor

committed as 9bf2bac

thank you !

@famod
Copy link
Contributor Author

famod commented Feb 3, 2019

You are welcome and thank you, too!

@famod famod closed this Feb 3, 2019
@jira-importer
Copy link

Resolve #794

1 similar comment
@jira-importer
Copy link

Resolve #794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants