# \#junit

**URL:** https://community.sonarsource.com/tag/junit/217.md

[Latest](https://community.sonarsource.com/latest.md) · [Categories](https://community.sonarsource.com/categories.md) · [Tags](https://community.sonarsource.com/tags.md)

---

## [SonarQube marks function refered by MethodSource as Unused "private" method per rule 1144](https://community.sonarsource.com/t/sonarqube-marks-function-refered-by-methodsource-as-unused-private-method-per-rule-1144/81572)

<div class="topic-metadata">

**Author:** [@Molzen](https://community.sonarsource.com/u/Molzen)\
**Replies:** 15\
**Last updated:** [November 15, 2024, 1:26pm UTC](https://community.sonarsource.com/t/sonarqube-marks-function-refered-by-methodsource-as-unused-private-method-per-rule-1144/81572 "2024-11-15T13:26:14Z")

</div>

UsingSonarQube Enterprise Edition Version 8.9.7 (build 52159) I am trying to use the new MethodSource functionality from Junit 5, but SonarQube marks the referenced function as an unused private method. As far as I can…

---

## [FP for rule 1144 on methods referred my MethodSource with multiple references](https://community.sonarsource.com/t/fp-for-rule-1144-on-methods-referred-my-methodsource-with-multiple-references/129062)

<div class="topic-metadata">

**Author:** [@joaocotralha](https://community.sonarsource.com/u/joaocotralha)\
**Replies:** 1\
**Last updated:** [November 1, 2024, 5:12pm UTC](https://community.sonarsource.com/t/fp-for-rule-1144-on-methods-referred-my-methodsource-with-multiple-references/129062 "2024-11-01T17:12:54Z")

</div>

Hi, Similar to: But the FP is presented only when using MethodSource with multiple argument syntax Example: private static Stream\<Arguments\> getArguments() { return Stream.of( Arguments.of("arg") ) } @Meth…

---

## [False positive for rule 1144 on method referred by JUnit's @MethodSource](https://community.sonarsource.com/t/false-positive-for-rule-1144-on-method-referred-by-junits-methodsource/116402)

<div class="topic-metadata">

**Author:** [@kim.martin](https://community.sonarsource.com/u/kim.martin)\
**Replies:** 6\
**Last updated:** [August 14, 2024, 1:44pm UTC](https://community.sonarsource.com/t/false-positive-for-rule-1144-on-method-referred-by-junits-methodsource/116402 "2024-08-14T13:44:10Z")

</div>

Hi, as someone else already stated here: SonarQube marks function refered by MethodSource as Unused "private" method per rule 1144 - #20 by RPluizberto Sonarqube falsely marks a method as false positive if it is a meth…

---

## [Sonar Gradle Plugin taking 1hr+ to scan single JUnit XML file (200k tests, 36MB)](https://community.sonarsource.com/t/sonar-gradle-plugin-taking-1hr-to-scan-single-junit-xml-file-200k-tests-36mb/108637)

<div class="topic-metadata">

**Author:** [@bdellegrazie](https://community.sonarsource.com/u/bdellegrazie)\
**Replies:** 3\
**Last updated:** [February 7, 2024, 12:55pm UTC](https://community.sonarsource.com/t/sonar-gradle-plugin-taking-1hr-to-scan-single-junit-xml-file-200k-tests-36mb/108637 "2024-02-07T12:55:57Z")

</div>

Hi, We’re getting extremely long scan times on a large Gradle project - however the vast majority of time appears to be around the ingestion of a very large JUnit file with 200k+ tests for a single module. JUnit XML out…

---

## [Sonar cloud does not pick up from the code coverage](https://community.sonarsource.com/t/sonar-cloud-does-not-pick-up-from-the-code-coverage/105246)

<div class="topic-metadata">

**Author:** [@nagarjuna183](https://community.sonarsource.com/u/nagarjuna183)\
**Replies:** 12\
**Last updated:** [December 1, 2023, 11:55am UTC](https://community.sonarsource.com/t/sonar-cloud-does-not-pick-up-from-the-code-coverage/105246 "2023-12-01T11:55:01Z")

</div>

Hi team, We are using Jest unit results publishing Cobetura.xml, which shows the Azure pipeline extension, This code coverage needs to show Sonar Cloud, but sonar does not pick it. Please help YMAL task: Npm@1 disp…

---

## [\- Unit Tests but 93% Coverage on 100 lines - Javascript LCOV working but not JUnit](https://community.sonarsource.com/t/unit-tests-but-93-coverage-on-100-lines-javascript-lcov-working-but-not-junit/57718)

<div class="topic-metadata">

**Author:** [@Paedy](https://community.sonarsource.com/u/Paedy)\
**Replies:** 3\
**Last updated:** [November 30, 2023, 11:08am UTC](https://community.sonarsource.com/t/unit-tests-but-93-coverage-on-100-lines-javascript-lcov-working-but-not-junit/57718 "2023-11-30T11:08:30Z")

</div>

Which versions are you using SonarQube™ 8.9.3 Scanner 5.2.0 JavaScript/TypeScript Code Quality and Security 8.5.0.16762 (javascript) SonarTS 2.1.0.4359 (typescript) XML Code Quality and Security 2.2.0.2973 (xml) Much m…

---

## [Junit test reports not imported](https://community.sonarsource.com/t/junit-test-reports-not-imported/89105)

<div class="topic-metadata">

**Author:** [@mohanss08](https://community.sonarsource.com/u/mohanss08)\
**Replies:** 4\
**Last updated:** [November 13, 2023, 10:11pm UTC](https://community.sonarsource.com/t/junit-test-reports-not-imported/89105 "2023-11-13T22:11:11Z")

</div>

I’m using sonarqube Community EditionVersion 9.9 with this version tried to upload junit test reports, my analysis completed successfully but Unit Test results can’t view on the dashboard Have the below project properti…

---

## [SonarQube generic test report is ignored](https://community.sonarsource.com/t/sonarqube-generic-test-report-is-ignored/103095)

<div class="topic-metadata">

**Author:** [@WhyYouNoFixBugs](https://community.sonarsource.com/u/WhyYouNoFixBugs)\
**Replies:** 2\
**Last updated:** [October 24, 2023, 2:00pm UTC](https://community.sonarsource.com/t/sonarqube-generic-test-report-is-ignored/103095 "2023-10-24T14:00:24Z")

</div>

Must-share information (formatted with Markdown): SonarQube version: Enterprise 10.2 Scanner CLI version: 5.0.1.3006 SonarQube is deployed via Docker Cucumber via JavaScript NPM: 9.1.2 I am trying to configure the Sona…

---

## [Kotlin Unit Test result not showing on SonarQube 9.0.1 developer](https://community.sonarsource.com/t/kotlin-unit-test-result-not-showing-on-sonarqube-9-0-1-developer/50229)

<div class="topic-metadata">

**Author:** [@devqmr](https://community.sonarsource.com/u/devqmr)\
**Replies:** 10\
**Last updated:** [September 25, 2023, 1:27pm UTC](https://community.sonarsource.com/t/kotlin-unit-test-result-not-showing-on-sonarqube-9-0-1-developer/50229 "2023-09-25T13:27:33Z")

</div>

Hi, Versions: SonarQube \> Developer EditionVersion 9.0.1 (build 46107) SonarScanner for Gradle plugin \> 3.3 We developed Android App written in Kotlin, we can see code coverage but we are not able to get unit test nu…

---

## [SonarQube unit tests with jest not showing up on dashboard](https://community.sonarsource.com/t/sonarqube-unit-tests-with-jest-not-showing-up-on-dashboard/99716)

<div class="topic-metadata">

**Author:** [@micky](https://community.sonarsource.com/u/micky)\
**Replies:** 1\
**Last updated:** [September 22, 2023, 3:04pm UTC](https://community.sonarsource.com/t/sonarqube-unit-tests-with-jest-not-showing-up-on-dashboard/99716 "2023-09-22T15:04:16Z")

</div>

SonarQube version: 9.9.1 developer version (build 69595) we have our unit tests done with jest and we want to have the numbers of unit test in the sonarqube dashboard. We run the tests first and then run the sonarscann…

---

## [Discrepancy between jacoco and sonarqube report](https://community.sonarsource.com/t/discrepancy-between-jacoco-and-sonarqube-report/98456)

<div class="topic-metadata">

**Author:** [@Mythri](https://community.sonarsource.com/u/Mythri)\
**Replies:** 1\
**Last updated:** [September 1, 2023, 8:47am UTC](https://community.sonarsource.com/t/discrepancy-between-jacoco-and-sonarqube-report/98456 "2023-09-01T08:47:42Z")

</div>

Hello. I’m trying to setup Sonarqube reporting for my repo. Code coverage on Sonarqube report is being reported as 0% while Jacoco report shows a coverage of 4%. Could you please help identify why this discrepancy exists…

---

## [Whitelisting calls to standard methods to avoid multiple invocation for runtime exception warnings](https://community.sonarsource.com/t/whitelisting-calls-to-standard-methods-to-avoid-multiple-invocation-for-runtime-exception-warnings/83375)

<div class="topic-metadata">

**Author:** [@NathanEckert](https://community.sonarsource.com/u/NathanEckert)\
**Replies:** 2\
**Last updated:** [March 3, 2023, 2:35pm UTC](https://community.sonarsource.com/t/whitelisting-calls-to-standard-methods-to-avoid-multiple-invocation-for-runtime-exception-warnings/83375 "2023-03-03T14:35:55Z")

</div>

Hi, I’m using Java with SonarCloud & SonarLint (plugin 7.4.0.60471 for IntelliJ). I am having what I consider false-positive for the rule java:S5778 “Only one method invocation is expected when testing runtime exceptio…

---

## [Sonar not showing number of unit tests from cpputest](https://community.sonarsource.com/t/sonar-not-showing-number-of-unit-tests-from-cpputest/78763)

<div class="topic-metadata">

**Author:** [@Simonas](https://community.sonarsource.com/u/Simonas)\
**Replies:** 10\
**Last updated:** [January 27, 2023, 1:22pm UTC](https://community.sonarsource.com/t/sonar-not-showing-number-of-unit-tests-from-cpputest/78763 "2023-01-27T13:22:56Z")

</div>

Hello, we’re using (SonarQube(Developer Edition Version 9.5 (build 56709)), SonarScanner 4.7.0.2747), C code and cpputest generates junit format xml’s. we’re trying to achieve a display number of unit tests execut…

---

## [Can't get SonarCloud to show Unit Tests](https://community.sonarsource.com/t/cant-get-sonarcloud-to-show-unit-tests/74699)

<div class="topic-metadata">

**Author:** [@Nicolas\_Buch](https://community.sonarsource.com/u/Nicolas_Buch)\
**Replies:** 1\
**Last updated:** [October 25, 2022, 7:10am UTC](https://community.sonarsource.com/t/cant-get-sonarcloud-to-show-unit-tests/74699 "2022-10-25T07:10:51Z")

</div>

Hi there I’ve spend the past few days trying to get more out of our SonarCloud. I’ve successfully set up PhpUnit coverage reports and PhpStan static analysis - but no matter what I do I can’t get PhpUnit test reports to…

---

## [New Java unit test causes quality gate to fail because it has no unit tests](https://community.sonarsource.com/t/new-java-unit-test-causes-quality-gate-to-fail-because-it-has-no-unit-tests/69854)

<div class="topic-metadata">

**Author:** [@mjremijan](https://community.sonarsource.com/u/mjremijan)\
**Replies:** 4\
**Last updated:** [August 17, 2022, 2:16pm UTC](https://community.sonarsource.com/t/new-java-unit-test-causes-quality-gate-to-fail-because-it-has-no-unit-tests/69854 "2022-08-17T14:16:36Z")

</div>

SonarQube version 8.9.6 (build 50800) Add a new Java unit test to my project We’ve run into another problem with the SonarQube new/updated code detection on branches. This time, a new Java junit test was added to the …

---

## [How to consume Code Coverage on JUnit Format for nodejs (Typescript apps)](https://community.sonarsource.com/t/how-to-consume-code-coverage-on-junit-format-for-nodejs-typescript-apps/55140)

<div class="topic-metadata">

**Author:** [@pragmaticivan](https://community.sonarsource.com/u/pragmaticivan)\
**Replies:** 1\
**Last updated:** [March 30, 2022, 11:16am UTC](https://community.sonarsource.com/t/how-to-consume-code-coverage-on-junit-format-for-nodejs-typescript-apps/55140 "2022-03-30T11:16:24Z")

</div>

Howdy! I’m using Sonar 9.2. Wondering if there are recommended ways to use Junit XML format test coverage from Typescript (nodejs) apps. Why? I already have a project using that type of reporter for other platforms and…

---

## [Searching a list of all supported testing frameworks](https://community.sonarsource.com/t/searching-a-list-of-all-supported-testing-frameworks/59870)

<div class="topic-metadata">

**Author:** [@anon67236913](https://community.sonarsource.com/u/anon67236913)\
**Replies:** 1\
**Last updated:** [March 15, 2022, 9:22am UTC](https://community.sonarsource.com/t/searching-a-list-of-all-supported-testing-frameworks/59870 "2022-03-15T09:22:53Z")

</div>

Hi, i know that it is possible to import reports from junit, jacoco, eslint and https://docs.sonarqube.org/latest/analysis/generic-issue/ What about i.e. cucumber, jest, rest assured, silk4j … etc. ? Is there a list …

---

## [Unable to see junit tests results on the dashboard using gradle 7.X scanner on sonarqube 8.9 LTS](https://community.sonarsource.com/t/unable-to-see-junit-tests-results-on-the-dashboard-using-gradle-7-x-scanner-on-sonarqube-8-9-lts/58526)

<div class="topic-metadata">

**Author:** [@danielleberre](https://community.sonarsource.com/u/danielleberre)\
**Replies:** 12\
**Last updated:** [February 21, 2022, 7:40pm UTC](https://community.sonarsource.com/t/unable-to-see-junit-tests-results-on-the-dashboard-using-gradle-7-x-scanner-on-sonarqube-8-9-lts/58526 "2022-02-21T19:40:22Z")

</div>

versions used (SonarQube, Scanner, Plugin, and any relevant extension) Sonarqube 8.9.2 Using docker image gradle:7.3-jdk11 Sonarqube gradle scanner 3.2.0 JUnit 5 tests (5.8.2) error observed (wrap logs/code arou…

---

## [Sonarqube Cannot Show Sum of .Net Core Unit Tests - NUnit And Vue.Js Unit Tests - Jest](https://community.sonarsource.com/t/sonarqube-cannot-show-sum-of-net-core-unit-tests-nunit-and-vue-js-unit-tests-jest/33323)

<div class="topic-metadata">

**Author:** [@hakanaltindis](https://community.sonarsource.com/u/hakanaltindis)\
**Replies:** 13\
**Last updated:** [February 2, 2022, 6:59am UTC](https://community.sonarsource.com/t/sonarqube-cannot-show-sum-of-net-core-unit-tests-nunit-and-vue-js-unit-tests-jest/33323 "2022-02-02T06:59:42Z")

</div>

I have an issue about Sonarqube Count of Unit Test corretly. My project’s backend is .net core web api project and frontend is VueJs project. I wrote unit test both of them. But I can not see total unit tests number afte…

---

## [Can't find test reports in Sonar Cloud (not coverage)](https://community.sonarsource.com/t/cant-find-test-reports-in-sonar-cloud-not-coverage/52694)

<div class="topic-metadata">

**Author:** [@Szer](https://community.sonarsource.com/u/Szer)\
**Replies:** 3\
**Last updated:** [November 23, 2021, 9:43am UTC](https://community.sonarsource.com/t/cant-find-test-reports-in-sonar-cloud-not-coverage/52694 "2021-11-23T09:43:52Z")

</div>

I’m uploading ktlint reports and junit test reports (not coverage, just execution) via sonar.kotlin.ktlint.reportPaths sonar.junit.reportPaths Sonarqube tool shows all good, but I just can’t find any UI element in Son…

---

## [Sonarqube does not 'see' a junit test report that is really there (test class naming or @TestFactory annotation issue?)](https://community.sonarsource.com/t/sonarqube-does-not-see-a-junit-test-report-that-is-really-there-test-class-naming-or-testfactory-annotation-issue/40975)

<div class="topic-metadata">

**Author:** [@pebble\_statue](https://community.sonarsource.com/u/pebble_statue)\
**Replies:** 1\
**Last updated:** [April 14, 2021, 9:11pm UTC](https://community.sonarsource.com/t/sonarqube-does-not-see-a-junit-test-report-that-is-really-there-test-class-naming-or-testfactory-annotation-issue/40975 "2021-04-14T21:11:00Z")

</div>

This is probably a duplicate, but a discourse search for sonar.junit.reportPaths yielded no results for me. $ ./gradlew :logging-core:sonarqube ... \> Task :logging-core:sonarqube Resource not found: xx.xxxxx.common.logg…

---

## [How to import Junit reports in SonarQube 8](https://community.sonarsource.com/t/how-to-import-junit-reports-in-sonarqube-8/38383)

<div class="topic-metadata">

**Author:** [@algonz](https://community.sonarsource.com/u/algonz)\
**Replies:** 0\
**Last updated:** [February 9, 2021, 6:09pm UTC](https://community.sonarsource.com/t/how-to-import-junit-reports-in-sonarqube-8/38383 "2021-02-09T18:09:02Z")

</div>

I have ant script for uploading projects to sonarQuebe 8.6. The problem is that I can’t see which test has been failed. In the dashboard I got how many junit test have been passed and how many have not. But it is impossi…

---

## [Problem with rule 'Test classes should comply with a naming convention'](https://community.sonarsource.com/t/problem-with-rule-test-classes-should-comply-with-a-naming-convention/37430)

<div class="topic-metadata">

**Author:** [@ankurja](https://community.sonarsource.com/u/ankurja)\
**Replies:** 10\
**Last updated:** [January 29, 2021, 6:53pm UTC](https://community.sonarsource.com/t/problem-with-rule-test-classes-should-comply-with-a-naming-convention/37430 "2021-01-29T18:53:43Z")

</div>

SonarQube v7.9.4 LTS SonarJava 5.13.1 (build 18282) It seems there is some problem with the Java rule - ‘Test classes should comply with a naming convention’ (squid:S3577). It does not report any violations with defaul…

---

## [JUnit Test - static quality code scan](https://community.sonarsource.com/t/junit-test-static-quality-code-scan/37183)

<div class="topic-metadata">

**Author:** [@Riel](https://community.sonarsource.com/u/Riel)\
**Replies:** 3\
**Last updated:** [January 22, 2021, 12:18pm UTC](https://community.sonarsource.com/t/junit-test-static-quality-code-scan/37183 "2021-01-22T12:18:08Z")

</div>

Qonarqube version: 8.6 (build 39681) Here is what I would like to achieve: For a given project, to enable some rules for code source AND for my junit tests. For example, the rule java:S2208 Wildcard imports should not …

---

## [JavaCheckVerifier problem when having multiple tests with multiple issues declared for the same line](https://community.sonarsource.com/t/javacheckverifier-problem-when-having-multiple-tests-with-multiple-issues-declared-for-the-same-line/33590)

<div class="topic-metadata">

**Author:** [@marian31ian](https://community.sonarsource.com/u/marian31ian)\
**Replies:** 4\
**Last updated:** [November 4, 2020, 10:34am UTC](https://community.sonarsource.com/t/javacheckverifier-problem-when-having-multiple-tests-with-multiple-issues-declared-for-the-same-line/33590 "2020-11-04T10:34:56Z")

</div>

Hello everyone, I was able to declare in the tests that I expect two/more issues on the same line. This worked very well until I have implemented another test with the same requirement (multiple issues on the same line…

---

## [Multiple issues on the same line unittests](https://community.sonarsource.com/t/multiple-issues-on-the-same-line-unittests/33513)

<div class="topic-metadata">

**Author:** [@marian31ian](https://community.sonarsource.com/u/marian31ian)\
**Replies:** 2\
**Last updated:** [October 27, 2020, 12:57pm UTC](https://community.sonarsource.com/t/multiple-issues-on-the-same-line-unittests/33513 "2020-10-27T12:57:13Z")

</div>

Hello everyone, I am developing a custom java plugin and during my tests I found out that sometimes I need to check that several issues are reported on the same line (in my case a method). I have added the // Noncompli…

---

## [Aggregating Junit5 XML report](https://community.sonarsource.com/t/aggregating-junit5-xml-report/30285)

<div class="topic-metadata">

**Author:** [@Anup\_Chandak](https://community.sonarsource.com/u/Anup_Chandak)\
**Replies:** 2\
**Last updated:** [August 31, 2020, 6:47pm UTC](https://community.sonarsource.com/t/aggregating-junit5-xml-report/30285 "2020-08-31T18:47:09Z")

</div>

Hello Team ! I have multi-module, multi-language repo which I am scanning using SonarScanner 4.3. On Sonar dashboard, I am not able to show unit test count of my Junit5 test. As per my debugging, understood that I have…

---

## [Junit testing with \`\`sonarscanner cli\`\`](https://community.sonarsource.com/t/junit-testing-with-sonarscanner-cli/28744)

<div class="topic-metadata">

**Author:** [@i\_ahsanraza](https://community.sonarsource.com/u/i_ahsanraza)\
**Replies:** 5\
**Last updated:** [August 7, 2020, 2:11pm UTC](https://community.sonarsource.com/t/junit-testing-with-sonarscanner-cli/28744 "2020-08-07T14:11:01Z")

</div>

I am using sonarqube 7.9.3-community version. For scanner, I am using docker sonar-scanner-cli , running in GitLab CI job to scan my code. Now I want to include unit testing as well. For this what I have unders…

---

## [Question about coverage for classes injected via Dagger from other project modules](https://community.sonarsource.com/t/question-about-coverage-for-classes-injected-via-dagger-from-other-project-modules/28718)

<div class="topic-metadata">

**Author:** [@lmonahan](https://community.sonarsource.com/u/lmonahan)\
**Replies:** 0\
**Last updated:** [July 27, 2020, 5:28pm UTC](https://community.sonarsource.com/t/question-about-coverage-for-classes-injected-via-dagger-from-other-project-modules/28718 "2020-07-27T17:28:05Z")

</div>

I have a question about code coverage: I have a large Android app with multiple modules as in: project - app-\>src-\>main-\>java-\>com-\>example-\>MyImportantClass - module1-\>src-\>main-\>java - module2-\>src-\>main-\>java …

---

## [Write better unit tests in Java thanks to a new set of rules dedicated to JUnit](https://community.sonarsource.com/t/write-better-unit-tests-in-java-thanks-to-a-new-set-of-rules-dedicated-to-junit/25081)

<div class="topic-metadata">

**Author:** [@Alexandre\_Gigleux](https://community.sonarsource.com/u/Alexandre_Gigleux)\
**Replies:** 3\
**Last updated:** [June 2, 2020, 8:45am UTC](https://community.sonarsource.com/t/write-better-unit-tests-in-java-thanks-to-a-new-set-of-rules-dedicated-to-junit/25081 "2020-06-02T08:45:46Z")

</div>

Hello Java developers, Whether you are a novice or an expert in writing unit tests, you will enjoy the 10 additional rules we added to help you write better unit tests. These rules come on top of the 15 existing ones al…

[Next page](https://community.sonarsource.com/tag/junit/217.md?match_all_tags=true&page=1&tags%5B%5D=junit)
