diff --git a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/classic/fuzzer/SimpleCommentForTestProducedByFuzzerBuilder.kt b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/classic/fuzzer/SimpleCommentForTestProducedByFuzzerBuilder.kt index feec3bf19f..11f6780246 100644 --- a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/classic/fuzzer/SimpleCommentForTestProducedByFuzzerBuilder.kt +++ b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/classic/fuzzer/SimpleCommentForTestProducedByFuzzerBuilder.kt @@ -8,6 +8,7 @@ import org.utbot.fuzzer.FuzzedMethodDescription import org.utbot.fuzzer.FuzzedValue import org.utbot.summary.SummarySentenceConstants.NEW_LINE import org.utbot.summary.comment.customtags.getClassReference +import org.utbot.summary.comment.customtags.getFullClassName import org.utbot.summary.comment.customtags.getMethodReferenceForFuzzingTest class SimpleCommentForTestProducedByFuzzerBuilder( @@ -21,7 +22,7 @@ class SimpleCommentForTestProducedByFuzzerBuilder( val methodName = methodDescription.compilableName val result = if (packageName != null && className != null && methodName != null) { - val fullClassName = "$packageName.$className" + val fullClassName = getFullClassName(packageName, className) val methodReference = getMethodReferenceForFuzzingTest( fullClassName, diff --git a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/customtags/CustomTagsUtil.kt b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/customtags/CustomTagsUtil.kt index cd64311a36..fda4050170 100644 --- a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/customtags/CustomTagsUtil.kt +++ b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/customtags/CustomTagsUtil.kt @@ -72,4 +72,9 @@ private fun formMethodReferenceForJavaDoc( */ fun getClassReference(fullClassName: String): String { return "{@link ${fullClassName.replace(JAVA_CLASS_DELIMITER, JAVA_DOC_CLASS_DELIMITER)}}".replace(CARRIAGE_RETURN, EMPTY_STRING) +} + +/** Returns correct full class name. */ +fun getFullClassName(packageName: String, className: String): String { + return if (packageName.isEmpty()) className else "$packageName.$className" } \ No newline at end of file diff --git a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/customtags/fuzzer/CommentWithCustomTagForTestProducedByFuzzerBuilder.kt b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/customtags/fuzzer/CommentWithCustomTagForTestProducedByFuzzerBuilder.kt index a61247e247..0a417eca29 100644 --- a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/customtags/fuzzer/CommentWithCustomTagForTestProducedByFuzzerBuilder.kt +++ b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/customtags/fuzzer/CommentWithCustomTagForTestProducedByFuzzerBuilder.kt @@ -7,6 +7,7 @@ import org.utbot.fuzzer.FuzzedMethodDescription import org.utbot.fuzzer.FuzzedValue import org.utbot.summary.SummarySentenceConstants.CARRIAGE_RETURN import org.utbot.summary.comment.customtags.getClassReference +import org.utbot.summary.comment.customtags.getFullClassName import org.utbot.summary.comment.customtags.getMethodReferenceForFuzzingTest import org.utbot.summary.comment.customtags.symbolic.CustomJavaDocTagProvider @@ -35,7 +36,7 @@ class CommentWithCustomTagForTestProducedByFuzzerBuilder( val methodName = methodDescription.compilableName return if (packageName != null && className != null && methodName != null) { - val fullClassName = "$packageName.$className" + val fullClassName = getFullClassName(packageName, className) val methodReference = getMethodReferenceForFuzzingTest( fullClassName,