pmayweg / sonar-groovy

SonarQube plugin for Groovy
GNU Lesser General Public License v3.0
52 stars 65 forks source link

Plugin produces 3 false positives in Spock Tests for every test method #89

Open enolive opened 5 years ago

enolive commented 5 years ago

We use the plugin mainly for our tests which are written in the awesome spock framework.

However, we noticed that at least three rules are applied to the test method name that don't make any sense in the context of a test method:

Here is some sample code that produces those issues

@SpringBootTest
class EndpointHealthCheckIntegrationTest extends Specification {
  @Autowired
  private EndpointHealthCheck healthCheck

  def "endpoint is up and running"() {
    when: 'health is queried'
    Health health = healthCheck.health().block()
    then: 'status should be up'
    health.status == Status.UP
  }
}

I resolve those issues as false positives and have to do it for every test method which is kinda annoying.