Avoid live HTTP clients in Java unit tests
HttpClient/URL/RestTemplate usage in unit tests should target fakes or embedded servers.
Search documentation pages and rules
Search documentation pages and rules
HttpClient/URL/RestTemplate usage in unit tests should target fakes or embedded servers.
java.testing.http-client-in-unit-testLive HTTP couples CI to the network.
Use MockWebServer, WireMock, or injected clients with deterministic responses.
The generated metadata points to critiq-rules/libs/rules/catalog/rules/java/java.testing.http-client-in-unit-test.rule.yaml.