Adds 62 unit tests covering previously-untested branches across the
client-basic SDK module, lifting line coverage from 86.51% to 99.45%
(1445/1453 lines, only 8 missed).
Highlights:
- New constants tests: Constants, RamConstants, IdentifyConstants,
NacosAuthLoginConstant.
- OIDC suite (OidcTokenHolder, OidcClientContext, OidcClientAuthServiceImpl)
now driven against an embedded jdk HttpServer to cover discovery + token
flow success/error paths without remote dependencies.
- Resource injector coverage: AiResourceInjector, LockResourceInjector
(full STS / V4 sign / invalid context paths).
- HttpClientManager: instance, timeout, factory internals via reflection,
shutdown error swallowing via Mockito.mockStatic on HttpClientBeanHolder.
- Constructor coverage added to TimerContext-style utility classes.
The 8 remaining lines are documented as unreachable / impractical:
- CredentialWatcher.java:74,209,211,229,230 — runnable early-return
after stop is fragile thread timing; classloader spas.properties path
would conflict with sibling tests.
- EndpointServerListProvider.java:156,159 — wait()/catch retry loop
requires forcing initial empty server list, edge-case-only.
- OidcTokenHolder.java:183,185 — UnsupportedEncodingException catch
for UTF-8, defensive code that JVM never triggers.
Assisted-by: Claude Code
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Change lineWrappingIndentation from 0 to 4 to match continuation_indentation=1
- Change arrayInitIndent from 8 to 4 to match continuation_indentation_for_array_initializer=1
- Remove all // @formatter:off/on workarounds (no longer needed)
- Re-format modules affected by continuation_indentation_for_array_initializer change
- Add checkstyle:check and spotless:check to CI check step
Signed-off-by: cxhello <caixiaohuichn@gmail.com>
Reduce Eclipse JDT Formatter continuation_indentation from 2 (8 spaces)
to 1 (4 spaces) to resolve conflict with Checkstyle IndentationCheck
(lineWrappingIndentation=0). The previous setting caused anonymous inner
class bodies to be indented at 20 spaces, exceeding Checkstyle's
expected range of {12, 16}.
Re-apply Spotless formatting to the 4 already-merged modules
(client-basic, client, k8s-sync, istio) with the corrected config.
Assisted-by: Claude Code
Signed-off-by: cxhello <caixiaohuichn@gmail.com>
Apply Eclipse JDT Formatter via Spotless to the client-basic module
as part of the codebase-wide formatting effort (#14815). Pure
formatting changes, no logic changes.
Assisted-by: Claude Code
Signed-off-by: cxhello <caixiaohuichn@gmail.com>
OidcClientContext.discover() and OidcTokenHolder.fetchToken() obtain
InputStreams from HttpURLConnection.getInputStream() and getErrorStream()
but never explicitly close them after reading. Wrap these streams in
try-with-resources to ensure proper cleanup.
- Add OidcClientAuthServiceImpl as AbstractClientAuthService SPI implementation
- Add OidcTokenHolder for token lifecycle management with proactive refresh window (20-30s before expiry)
- Add OidcClientContext for configuration loading and OIDC Discovery support
- Add OidcClientConstants for client-side config key definitions
- Extract shared protocol-level constants into OidcProtocolConstants (plugin/auth module) to be reused by both client and server
- Migrate server-side OidcConstants usages to OidcProtocolConstants where applicable
- Remove unused OidcSessionManager dead code
- Register OidcClientAuthServiceImpl in SPI META-INF/services
Add explicit StandardCharsets.UTF_8 to all DM_DEFAULT_ENCODING
occurrences reported by SpotBugs under threshold=High, and remove
the global exclusion from spotbugs-exclude.xml.
Affected modules: client-basic, client, common, config, core,
k8s-sync, naming, sys.
Signed-off-by: cxhello <caixiaohuichn@gmail.com>
* Fix nacos client and relative depend ut.
* Fix nacos config ut.
* Fix nacos console ut.
* Fix nacos core ut.
* Fix nacos naming ut.
* Fix nacos default-auth-plugin-impl ut.
* Fix nacos prometheus ut.