Hi, in general mocking (when it involves class files transformation) does not play well with JaCoCo.
What exactly is your “local” tooling which works? Regards, -marc > On 16. Aug 2023, at 13:10, Sidhartha Das <[email protected]> wrote: > > Hi, > > I am trying to execute Jacoco report. I have some static method which I have > written test cases using Mock static. In local It shows Junit coverage. But > In Jacoco report I dnt see the coverage for static methods. Can you please > suggest. > Below the build.gradle > > plugins { > id 'org.springframework.boot' version '2.3.2.RELEASE' > id 'io.spring.dependency-management' version '1.0.9.RELEASE' > id 'java' > id 'jacoco' //jacoco plugin > } > > group = 'com.stackfortech' > version = '0.0.1-SNAPSHOT' > sourceCompatibility = '1.8' > > repositories { > mavenCentral() > } > > dependencies { > implementation 'org.springframework.boot:spring-boot-starter-web' > testImplementation('org.springframework.boot:spring-boot-starter-test') > { > exclude group: 'org.junit.vintage', module: > 'junit-vintage-engine' > } > } > test { > useJUnitPlatform() > finalizedBy jacocoTestReport //run right after ./gradlew clean build > } > jacocoTestReport{ //configuration for report formats. > dependsOn test > reports { > xml.enabled true > csv.enabled true > html.enabled true > } > finalizedBy jacocoTestCoverageVerification //run right after > jacocoTestReport > } > jacocoTestCoverageVerification { //Verifies the code coverage rule if > enabled. > violationRules { > rule { > enabled = true > limit { > minimum = 0.25 > } > } > } > } > > -- > You received this message because you are subscribed to the Google Groups > "JaCoCo and EclEmma Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jacoco/33f46448-c580-4357-a08f-563139b89449n%40googlegroups.com > > <https://groups.google.com/d/msgid/jacoco/33f46448-c580-4357-a08f-563139b89449n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/A44A86CB-CF0E-4B50-BE7A-3861BC9C7FFF%40mountainminds.com.
