|
15 | 15 | import org.postgresql.core.Version; |
16 | 16 | import org.postgresql.jdbc.PreferQueryMode; |
17 | 17 | import org.postgresql.test.TestUtil; |
| 18 | +import org.postgresql.util.internal.Nullness; |
18 | 19 |
|
19 | 20 | import org.checkerframework.checker.nullness.qual.Nullable; |
20 | 21 | import org.junit.jupiter.api.AfterEach; |
@@ -72,7 +73,7 @@ public final void setBinaryMode(BinaryMode binaryMode) { |
72 | 73 | this.binaryMode = binaryMode; |
73 | 74 | } |
74 | 75 |
|
75 | | - public StringType getStringType() { |
| 76 | + public @Nullable StringType getStringType() { |
76 | 77 | return stringType; |
77 | 78 | } |
78 | 79 |
|
@@ -161,24 +162,28 @@ public void assumeNotSimpleQueryMode() { |
161 | 162 | * Shorthand for {@code Assume.assumeTrue(TestUtil.haveMinimumServerVersion(conn, version)}. |
162 | 163 | */ |
163 | 164 | public void assumeMinimumServerVersion(String message, Version version) throws SQLException { |
| 165 | + Connection con = Nullness.castNonNull(this.con, "connection"); |
164 | 166 | assumeTrue(TestUtil.haveMinimumServerVersion(con, version), message); |
165 | 167 | } |
166 | 168 |
|
167 | 169 | /** |
168 | 170 | * Shorthand for {@code Assume.assumeTrue(TestUtil.haveMinimumServerVersion(conn, version)}. |
169 | 171 | */ |
170 | 172 | public void assumeMinimumServerVersion(Version version) throws SQLException { |
| 173 | + Connection con = Nullness.castNonNull(this.con, "connection"); |
171 | 174 | assumeTrue(TestUtil.haveMinimumServerVersion(con, version)); |
172 | 175 | } |
173 | 176 |
|
174 | 177 | protected void assertBinaryForReceive(int oid, boolean expected, Supplier<String> message) throws SQLException { |
| 178 | + Connection con = Nullness.castNonNull(this.con, "connection"); |
175 | 179 | assertEquals( |
176 | 180 | expected, |
177 | 181 | con.unwrap(BaseConnection.class).getQueryExecutor().useBinaryForReceive(oid), |
178 | 182 | () -> message.get() + ", useBinaryForReceive(oid=" + oid + ")"); |
179 | 183 | } |
180 | 184 |
|
181 | 185 | protected void assertBinaryForSend(int oid, boolean expected, Supplier<String> message) throws SQLException { |
| 186 | + Connection con = Nullness.castNonNull(this.con, "connection"); |
182 | 187 | assertEquals( |
183 | 188 | expected, |
184 | 189 | con.unwrap(BaseConnection.class).getQueryExecutor().useBinaryForSend(oid), |
|
0 commit comments