diff --git a/approvaltests-tests/src/test/java/org/approvaltests/ApprovalsDuplicateVerifyExceptionTest.testExceptionMessage.approved.txt b/approvaltests-tests/src/test/java/org/approvaltests/ApprovalsDuplicateVerifyExceptionTest.testExceptionMessage.approved.txt index b468846fb..d8e8666fe 100644 --- a/approvaltests-tests/src/test/java/org/approvaltests/ApprovalsDuplicateVerifyExceptionTest.testExceptionMessage.approved.txt +++ b/approvaltests-tests/src/test/java/org/approvaltests/ApprovalsDuplicateVerifyExceptionTest.testExceptionMessage.approved.txt @@ -1,11 +1,11 @@ org.approvaltests.ApprovalsDuplicateVerifyException: Already approved: file.txt By default, ApprovalTests only allows one verify() call per test. -To find out more, visit: +To find out more, visit: https://github.com/approvals/ApprovalTests.Java/blob/master/approvaltests/docs/reference/Naming.md # Fixes 1. separate your test into two tests 2. add NamedParameters with the NamerFactory -3. Override Approvals.settings() with either - a. allowMultipleVerifyCallsForThisClass - b. allowMultipleVerifyCallsForThisMethod \ No newline at end of file +3. Override Approvals.settings() with either + a. allowMultipleVerifyCallsForThisClass + b. allowMultipleVerifyCallsForThisMethod \ No newline at end of file diff --git a/approvaltests-tests/src/test/java/org/approvaltests/inline/InlineApprovalsTest.java b/approvaltests-tests/src/test/java/org/approvaltests/inline/InlineApprovalsTest.java index 751c3afa1..a5f687c52 100644 --- a/approvaltests-tests/src/test/java/org/approvaltests/inline/InlineApprovalsTest.java +++ b/approvaltests-tests/src/test/java/org/approvaltests/inline/InlineApprovalsTest.java @@ -200,11 +200,11 @@ void testSemiAutomaticMessage() void testSemiAutomaticWithPreviousApproved() { var expected = """ - 42 - ***** DELETE ME TO APPROVE ***** - vvvvv PREVIOUS RESULT vvvvv - 41 - """; + 42 + ***** DELETE ME TO APPROVE ***** + vvvvv PREVIOUS RESULT vvvvv + 41 + """; var options = new Options().inline(expected, InlineOptions.semiAutomaticWithPreviousApproved()); try { diff --git a/approvaltests/pom.xml b/approvaltests/pom.xml index ccb8d555a..4b295e49f 100644 --- a/approvaltests/pom.xml +++ b/approvaltests/pom.xml @@ -164,6 +164,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 15 + 15 + + diff --git a/approvaltests/src/main/java/org/approvaltests/ApprovalsDuplicateVerifyException.java b/approvaltests/src/main/java/org/approvaltests/ApprovalsDuplicateVerifyException.java index eb5119b5a..36e41f07c 100644 --- a/approvaltests/src/main/java/org/approvaltests/ApprovalsDuplicateVerifyException.java +++ b/approvaltests/src/main/java/org/approvaltests/ApprovalsDuplicateVerifyException.java @@ -4,11 +4,17 @@ public class ApprovalsDuplicateVerifyException extends RuntimeException { public ApprovalsDuplicateVerifyException(String file) { - super("Already approved: " + file + "\n" - + "By default, ApprovalTests only allows one verify() call per test.\n" + "To find out more, visit: \n" - + "https://github.com/approvals/ApprovalTests.Java/blob/master/approvaltests/docs/reference/Naming.md\n\n" - + "# Fixes\n" + "1. separate your test into two tests\n" + "2. add NamedParameters with the NamerFactory\n" - + "3. Override Approvals.settings() with either \n" + "\ta. allowMultipleVerifyCallsForThisClass\n" - + "\tb. allowMultipleVerifyCallsForThisMethod"); + super(""" + Already approved: %s + By default, ApprovalTests only allows one verify() call per test. + To find out more, visit: + https://github.com/approvals/ApprovalTests.Java/blob/master/approvaltests/docs/reference/Naming.md + + # Fixes + 1. separate your test into two tests + 2. add NamedParameters with the NamerFactory + 3. Override Approvals.settings() with either + a. allowMultipleVerifyCallsForThisClass + b. allowMultipleVerifyCallsForThisMethod""".formatted(file));; } }