diff --git a/src/main/java/org/assertj/assertions/generator/BaseAssertionGenerator.java b/src/main/java/org/assertj/assertions/generator/BaseAssertionGenerator.java index 7d9cd41e..d9898c6f 100644 --- a/src/main/java/org/assertj/assertions/generator/BaseAssertionGenerator.java +++ b/src/main/java/org/assertj/assertions/generator/BaseAssertionGenerator.java @@ -473,13 +473,19 @@ private String generateAssertionEntryPointMethodsFor(final Set // resolve class (ex: Player) // in case of inner classes like Movie.PublicCategory use class name with outer class i.e. Movie.PublicCategory. assertionEntryPointMethodContent = replace(assertionEntryPointMethodContent, CLASS_TO_ASSERT, - classDescription.getFullyQualifiedClassName()); + getAssertClassName(classDescription)); allAssertThatsContentBuilder.append(lineSeparator).append(assertionEntryPointMethodContent); } return allAssertThatsContentBuilder.toString(); } + private String getAssertClassName(final ClassDescription classDescription) { + return generatedAssertionsPackage == null ? + classDescription.getFullyQualifiedAssertClassName() : + generatedAssertionsPackage + "." + classDescription.getAssertClassName(); + } + private String determineBestEntryPointsAssertionsClassPackage(final Set classDescriptionSet) { if (generatedAssertionsPackage != null) { return generatedAssertionsPackage; @@ -497,7 +503,7 @@ private String determineBestEntryPointsAssertionsClassPackage(final Set