Sonar coverage after upgrade of spring boot - spring

I have upgraded one of my spring boot projects to 2.7.5 version and after analysis of projet on sonarqube server I got a 0% coverage, even I have already lot of unit tests.
Any idea of what is causing this ?
I have tried to reanalyse my project using mvn sonar:sonar but in vain

Related

Spring boot application is not picking all the test cases for execution after migrating spring boot 2.5.12

We have spring-boot application ,when we try to run unit tests it seems that some of the unit tests cases are not picking for execution.
This issue started happening after upgrading spring boot version from 2.3.9 to 2.5.12
We are using java 11,gradle 6.8 and gradle dependency testCompile 'junit:junit:4.12'
Any reason of not picking all the test cases for execution?
Check the Spring Boot 2.4 release notes regarding JUnit 5:
If you do not want to migrate your tests to JUnit 5 and wish to continue using JUnit 4, add a dependency on the Vintage Engine
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.4-Release-Notes#junit-5s-vintage-engine-removed-from-spring-boot-starter-test

How to disable Sonatype Scan Spring-Web

I'm getting security vulnerabilities for spring web jars in Sonartype scanning, leading Bamboo builds failure.
My question is how to disable the Sonar from scanning these jars? Something like, configure in Gradle, Maven or Bamboo?
We already use 2.2.* version SpringBoot, so upgrade is not considered.
Thanks in advance.

Adding a gatling test to a Spring Boot gradle project on IntelliJ

I have a Spring Boot 2 application written in Kotlin (could be Java). The project uses gradle (not maven). The application exposes HTTP endpoints that I want to load test using gatling.
I created a MySimulation.scala file under src/test/gatling. IntelliJ suggested and I accepted the intallation of the Scala IntelliJ plugin. So, I got syntax highliting on the scala editor. :^)
I'd like to have code assist (drill down, code completion) for the scala gatling tests.
What other tools/plugins/configuration do I need to add?
(I have the gatling bundle already installed on my computer. IntelliJ version is 2018.2.4.)

RestAssured Spring Boot Test returning 404s

I am building an API using Spring Boot and Katharsis. When writing integration tests using RestAssured my tests are passing in STS but getting 404s in Maven. I'm not sure what the difference might be or why it isn't working.
Running the API things are working as expected.
I was wondering if anyone had any thoughts?
Code Repo is here: https://github.com/Holmes89/liturgical-project
So the problem had to do with the fact Reflections wasn't populating my ResourcesRepository on test startup. I found a similar problem here:
Unit test using the Reflections google library fails only when executed by Maven
And used the following link to configure the Maven Surefire Plugin:
http://maven.apache.org/surefire/maven-surefire-plugin/examples/class-loading.html
Adding the following config helped:
<useSystemClassLoader>false</useSystemClassLoader>

Allure gradle integration

I'm trying to integrate Allure reports into a Gradle build. It seems there is no direct support for Gradle overall (all Maven) and only some recent support for TestNG. Digging further I see a number of issues with Gradle not supporting JUnit listeners, but they do support TestNG listeners (because TestNG does). I've tried a gradle integration following the Maven pom as guideline for the JUnit plugin, but it obviously produces no output.
So I guess my question is :
Will there be any gradle support coming soon or will we have to wait for Gradle to enable some sort of JUNit listener facility first?
If none of the above, has anyone done a custom integration ?
Allure TestNG Gradle example here https://github.com/allure-examples/allure-gradle-testng-example
It's works because TestNG supports Java SPI for adding test listeners. But JUnit does't have such feature. You can check out the following PR to JUnit https://github.com/junit-team/junit/pull/923
If you need Gradle support for JUnit right now you can try to implement Gradle Test Listener (http://www.gradle.org/docs/current/javadoc/org/gradle/api/tasks/testing/TestListener.html)
Hope it helps

Resources