TestNG Listener Callback Order: What Actually Fires

testng listeners

Run java -cp testng-7.12.0.jar:jcommander-1.83.jar:slf4j-api-2.0.16.jar:. org.testng.TestNG -testclass YourTest and TestNG calls your listeners in a fixed order: suite-level first, then per-method onTestStart → beforeInvocation → your test body → afterInvocation → the pass/fail/skip callback, repeated per method, then suite-level again on the way out. That order — and what happens to a listener when a test … Read more

SonarQube API Guide: curl Calls, Deprecations, Java Client

sonarqube api

Every SonarQube Web API call is a plain HTTP request with a token. Two calls that worked unauthenticated against SonarQube Cloud on 15 October 2026, on the public project SonarSource_sonarqube-scan-action: $ B=https://sonarcloud.io $ K=SonarSource_sonarqube-scan-action $ curl -s “$B/api/measures/component?component=$K&metricKeys=ncloc,bugs,coverage” | jq -c .component {“id”:”AZ1sHZl_D2-gFGkFqVHI”,”key”:”SonarSource_sonarqube-scan-action”,”name”:”sonarqube-scan-action”,”qualifier”:”TRK”,”measures”:[{“metric”:”bugs”,”value”:”0″,”bestValue”:true},{“metric”:”ncloc”,”value”:”710″}]} $ curl -s “$B/api/qualitygates/project_status?projectKey=$K” | jq -r .projectStatus.status OK That project reports … Read more

SonarQube and Jenkins: The Webhook That Makes the Gate Work

integrate sonarqube with jenkins

A Jenkins pipeline that calls withSonarQubeEnv and stops there does not gate anything. It runs the analysis, ships the results to SonarQube, and reports success whatever the quality gate says. To actually fail the build you need two more things — the waitForQualityGate step, and a webhook configured in SonarQube pointing back at Jenkins. Miss … Read more

JaCoCo Coverage Gates in SonarQube: Default Gate Checks

Java code on a computer screen

Two things to know before any setup steps. First, SonarQube’s default quality gate does not gate your project’s overall coverage — all four of its conditions are on new code. Second, JaCoCo 0.8.4 cannot instrument modern Java bytecode, and when it fails it reports 0% coverage while your build still exits 0. That second one … Read more