From f1f348b7657f676212b0e1d19cfadb9c8ed041f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=B0=D1=80=D0=B0=D0=B1=D0=B0=D0=BD=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D0=BE=D1=84=D0=B5=D0=B9=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Mon, 28 Aug 2023 13:53:52 +0300 Subject: [PATCH] fix issue #122 --- .../generator/BaseAssertionGenerator.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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