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, 23 Sep 2026 06:43:35 +0000
Message-ID: <gh-pgjdbc-pgjdbc-4251-rc4079734735@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/core/v3/ReadMechanismsTest.java:68)
The stub ignores the read position, so `verify(stream).receive(n)` can't show where the stream ended up. Use a real `PGStream` over `CannedSocketFactory` (already in `pgjdbc/src/test/.../core/`), put an `'E'` after the message, and assert that the next `receiveChar()` returns it. That also removes the mock of a class the test doesn't own.
Please add the cases from the comment on `readMechanisms`: bytes after the terminating empty name, and an empty first name. `rejectsUnterminatedMechanismName` (line 99) is misnamed: the name is terminated, and what is missing is the list terminator.