Skip to content

Commit 174d6fa

Browse files
author
Барабанов Тимофей Андреевич
committed
fix issue #122
1 parent 159bafd commit 174d6fa

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/main/java/org/assertj/assertions/generator/BaseAssertionGenerator.java

+8-5
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,9 @@ private String generateAssertionEntryPointMethodsFor(final Set<ClassDescription>
473473
// resolve class (ex: Player)
474474
// in case of inner classes like Movie.PublicCategory use class name with outer class i.e. Movie.PublicCategory.
475475
assertionEntryPointMethodContent = replace(assertionEntryPointMethodContent, CLASS_TO_ASSERT,
476-
classDescription.getFullyQualifiedClassName());
476+
generatedAssertionsPackage == null ?
477+
classDescription.getFullyQualifiedAssertClassName() :
478+
generatedAssertionsPackage + "." + classDescription.getAssertClassName());
477479

478480
allAssertThatsContentBuilder.append(lineSeparator).append(assertionEntryPointMethodContent);
479481
}
@@ -497,7 +499,7 @@ private String determineBestEntryPointsAssertionsClassPackage(final Set<ClassDes
497499
/**
498500
* Returns the target directory path where the assertions file for given classDescription will be created.
499501
*
500-
* @param packageName package name
502+
* @param packageName package name
501503
* @return the target directory path corresponding to the given package.
502504
*/
503505
private String getDirectoryPathCorrespondingToPackage(final String packageName) {
@@ -607,11 +609,12 @@ private String assertionContentForField(FieldDescription field, ClassDescription
607609

608610
private String getTypeName(DataDescription fieldOrGetter) {
609611
if (generatedAssertionsPackage != null) {
610-
// if the user has chosen to generate assertions in a given package we assume that
612+
// if the user has chosen to generate assertions in a given package we assume that
611613
return fieldOrGetter.getFullyQualifiedTypeName();
612614
}
613-
// returns a simple class name if the field or getter type is in the same package as its owning type which is the package where the
614-
// Assert class is generated.
615+
// returns a simple class name if the field or getter type is in the same package as its owning type which is the package
616+
// where the
617+
// Assert class is generated.
615618
return fieldOrGetter.getTypeName();
616619
}
617620

0 commit comments

Comments
 (0)