diff --git a/sonar-zpa-plugin/src/main/kotlin/org/sonar/plsqlopen/utplsql/TestResultImporter.kt b/sonar-zpa-plugin/src/main/kotlin/org/sonar/plsqlopen/utplsql/TestResultImporter.kt index 168acbd9..49d516b8 100644 --- a/sonar-zpa-plugin/src/main/kotlin/org/sonar/plsqlopen/utplsql/TestResultImporter.kt +++ b/sonar-zpa-plugin/src/main/kotlin/org/sonar/plsqlopen/utplsql/TestResultImporter.kt @@ -41,7 +41,8 @@ class TestResultImporter(private val objectLocator: ObjectLocator, val testExecutions = serializer.read(TestExecutions::class.java, report) testExecutions.files?.forEach { file -> - val mappedTest = objectLocator.findTestObject(file.path, PlSqlGrammar.CREATE_PACKAGE_BODY) + val packageName = file.path.substringAfterLast('.') + val mappedTest = objectLocator.findTestObject(packageName, PlSqlGrammar.CREATE_PACKAGE) val inputFile = mappedTest?.inputFile ?: context.fileSystem() .inputFile(context.fileSystem().predicates().hasPath(file.path)) diff --git a/sonar-zpa-plugin/src/test/resources/org/sonar/plsqlopen/utplsql/test-report-without-paths.xml b/sonar-zpa-plugin/src/test/resources/org/sonar/plsqlopen/utplsql/test-report-without-paths.xml index 68efb863..54abf31e 100644 --- a/sonar-zpa-plugin/src/test/resources/org/sonar/plsqlopen/utplsql/test-report-without-paths.xml +++ b/sonar-zpa-plugin/src/test/resources/org/sonar/plsqlopen/utplsql/test-report-without-paths.xml @@ -1,6 +1,6 @@ - +