Use consistent wording in precondition error messages

This commit is contained in:
Sam Brannen
2022-11-06 11:57:34 +01:00
parent 711a63adca
commit 2aa78889d2
27 changed files with 88 additions and 86 deletions

View File

@@ -44,8 +44,8 @@ class InvocationsRecorderClassTransformer implements ClassFileTransformer {
private final String[] ignoredPackages;
public InvocationsRecorderClassTransformer(String[] instrumentedPackages, String[] ignoredPackages) {
Assert.notNull(instrumentedPackages, "instrumentedPackages should not be null");
Assert.notNull(ignoredPackages, "ignoredPackages should not be null");
Assert.notNull(instrumentedPackages, "instrumentedPackages must not be null");
Assert.notNull(ignoredPackages, "ignoredPackages must not be null");
this.instrumentedPackages = rewriteToAsmFormat(instrumentedPackages);
this.ignoredPackages = rewriteToAsmFormat(ignoredPackages);
}

View File

@@ -74,7 +74,7 @@ public class RuntimeHintsInvocationsAssert extends AbstractAssert<RuntimeHintsIn
* @throws AssertionError if any of the recorded invocations has no match in the provided hints
*/
public void match(RuntimeHints runtimeHints) {
Assert.notNull(runtimeHints, "RuntimeHints should not be null");
Assert.notNull(runtimeHints, "RuntimeHints must not be null");
configureRuntimeHints(runtimeHints);
List<RecordedInvocation> noMatchInvocations =
this.actual.recordedInvocations().filter(invocation -> !invocation.matches(runtimeHints)).toList();
@@ -84,7 +84,7 @@ public class RuntimeHintsInvocationsAssert extends AbstractAssert<RuntimeHintsIn
}
public ListAssert<RecordedInvocation> notMatching(RuntimeHints runtimeHints) {
Assert.notNull(runtimeHints, "RuntimeHints should not be null");
Assert.notNull(runtimeHints, "RuntimeHints must not be null");
configureRuntimeHints(runtimeHints);
return ListAssert.assertThatStream(this.actual.recordedInvocations()
.filter(invocation -> !invocation.matches(runtimeHints)));

View File

@@ -48,7 +48,7 @@ public final class RuntimeHintsRecorder {
* @return the recorded invocations
*/
public synchronized static RuntimeHintsInvocations record(Runnable action) {
Assert.notNull(action, "Runnable action should not be null");
Assert.notNull(action, "Runnable action must not be null");
Assert.isTrue(RuntimeHintsAgent.isLoaded(), "RuntimeHintsAgent should be loaded in the current JVM");
RuntimeHintsRecorder recorder = new RuntimeHintsRecorder();
RecordedInvocationsPublisher.addListener(recorder.listener);