I have a spring-boot
application where my @SpringBootApplication
starter class looks like a standard one. So I created many tests for all my functi
I solved in a different way here. Since this method is there only as a bridge to Spring's run, I annotated the method with @lombok.Generated
and now sonar ignores it when calculating the test coverage.
Other @Generated
annotations, like javax.annotation.processing.Generated
or javax.annotation.Generated
might also work but I can't test now because my issue ticket was closed.
package com.stackoverflow;
import lombok.Generated;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
@Generated
public static void main(String... args) {
SpringApplication.run(Application.class, args);
}
}