Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue #122 #214

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -473,13 +473,19 @@ private String generateAssertionEntryPointMethodsFor(final Set<ClassDescription>
// 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<ClassDescription> classDescriptionSet) {
if (generatedAssertionsPackage != null) {
return generatedAssertionsPackage;
Expand All @@ -497,7 +503,7 @@ private String determineBestEntryPointsAssertionsClassPackage(final Set<ClassDes
/**
* Returns the target directory path where the assertions file for given classDescription will be created.
*
* @param packageName package name
* @param packageName package name
* @return the target directory path corresponding to the given package.
*/
private String getDirectoryPathCorrespondingToPackage(final String packageName) {
Expand Down Expand Up @@ -607,11 +613,12 @@ private String assertionContentForField(FieldDescription field, ClassDescription

private String getTypeName(DataDescription fieldOrGetter) {
if (generatedAssertionsPackage != null) {
// if the user has chosen to generate assertions in a given package we assume that
// if the user has chosen to generate assertions in a given package we assume that
return fieldOrGetter.getFullyQualifiedTypeName();
}
// 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
// Assert class is generated.
// 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
// Assert class is generated.
return fieldOrGetter.getTypeName();
}

Expand Down