Skip to content

Commit 30dffe8

Browse files
committed
test: pin getObject(int, Map) null/empty fast path
Drive-by pin test: StreamingResultSet.getObject(int, Map<String,Class<?>>) with a null or empty type map should behave like plain getObject(int) per the JDBC spec. Previously not asserted anywhere. The companion getObject(Class) fallback test landed earlier on this branch, bundled into the QueryJDBCAccessor base-class fix commit so the fix and its end-to-end coverage ship as a single cherry-pickable unit.
1 parent 8b013d1 commit 30dffe8

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

jdbc-core/src/test/java/com/salesforce/datacloud/jdbc/core/StreamingResultSetMethodTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,18 @@ void getObjectWithClassUsesAccessorBaseFallback() throws Exception {
202202
}
203203
}
204204

205+
@Test
206+
void getObjectWithNullTypeMapBehavesLikeGetObject() throws Exception {
207+
// JDBC: getObject(int, Map) with a null/empty type map should behave like getObject(int).
208+
try (val rs = createResultSet()) {
209+
rs.next();
210+
val plain = rs.getObject(1);
211+
assertThat(rs.getObject(1, (java.util.Map<String, Class<?>>) null)).isEqualTo(plain);
212+
assertThat(rs.getObject(1, java.util.Collections.<String, Class<?>>emptyMap()))
213+
.isEqualTo(plain);
214+
}
215+
}
216+
205217
@Test
206218
void queryId() throws Exception {
207219
try (val rs = createResultSet()) {

0 commit comments

Comments
 (0)