Skip to content

Commit

Permalink
Add className value to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrFLEURY committed Nov 15, 2023
1 parent 8eebb5e commit 8115c43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ default void addFile(Kind kind, String path, ThrowingConsumer<Appendable> conten

private static String getClassNamePath(String className) {
Assert.hasLength(className, "'className' must not be empty");
Assert.isTrue(isJavaIdentifier(className), "'className' must be a valid identifier");
Assert.isTrue(isJavaIdentifier(className), "'className' " + className + " must be a valid identifier");
return ClassUtils.convertClassNameToResourcePath(className) + ".java";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void addSourceFileWithCharSequenceWhenClassNameIsInvalidThrowsException() {
assertThatIllegalArgumentException()
.isThrownBy(() -> this.generatedFiles
.addSourceFile("com/example/HelloWorld.java", "{}"))
.withMessage("'className' must be a valid identifier");
.withMessage("'className' com/example/HelloWorld.java must be a valid identifier");
}

@Test
Expand Down

0 comments on commit 8115c43

Please sign in to comment.