psiroky commented on code in PR #213: URL: https://github.com/apache/maven-enforcer/pull/213#discussion_r1059280557
########## enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaVendor.java: ########## @@ -56,25 +54,33 @@ public void matchingInclude() throws EnforcerRuleException { } @Test - public void nonMatchingInclude() { + void nonMatchingInclude() { // Set the included vendor to something irrelevant underTest.setIncludes(Collections.singletonList(NON_MATCHING_VENDOR)); final EnforcerRuleHelper helper = EnforcerTestUtils.getHelper(); - EnforcerRuleException e = assertThrows(EnforcerRuleException.class, () -> underTest.execute(helper)); - assertThat(e.getMessage(), is(SystemUtils.JAVA_VENDOR + " is not an included Required Java Vendor")); + + assertThatThrownBy(() -> underTest.execute(helper)) + .isInstanceOf(EnforcerRuleException.class) + .hasMessage( + "%s is not an included Required Java Vendor (JAVA_HOME=%s)", + SystemUtils.JAVA_VENDOR, SystemUtils.JAVA_HOME); Review Comment: I replaced the exception assserts with AssertJ since I find those much easier to read and understand (and I noticed the project uses asserj elsewhere as well). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org