From: vlsi (@vlsi) <noreply+vlsi@github.com>
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Subject: Re: [pgjdbc/pgjdbc] PR #4251: OAuth implementation
Date: Wed, 09 Sep 2026 15:45:37 +0000
Message-ID: <gh-pgjdbc-pgjdbc-4251-rc3970363401@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-4251@github.com>
References: <gh-pgjdbc-pgjdbc-4251@github.com>
(on pgjdbc-mockito-test/src/test/java/org/postgresql/test/core/v3/OAuthAuthenticatorTest.java)
`assertEquals(1, warnings.size())` prints `expected: <1> but was: <0>` and carries no message, so a failure says nothing about which records were there. The same shape appears at lines 79, 87, 96, 105 and 117 as `assertEquals(0, logHandler.records.size(), ...)`. Asserting on the list of messages instead prints what actually arrived.
This class is otherwise the best-tested part of the change: `{TLS, GSS, unencrypted} × {require, allow}` is complete and the negative control is there. Since the six methods differ only in their inputs, one `@ParameterizedTest` with `argumentSet("TLS socket, encryption required", ...)` would say so.
A class comment would help too, in the shape its sibling `ScramAuthenticatorChannelBindingTest` uses: the rule guarded rather than the subject. Something like `A TLS- or GSS-encrypted connection admits OAUTHBEARER silently, an unencrypted one is refused, and oauthAllowUnencryptedConnection turns that refusal into a single WARNING record.`
Two small ones: `"no log records expected over a GSS"` reads oddly, `over a GSS-encrypted connection` fits; and line 117 is missing a space after the comma.