Skip to content

Commit 6b1c463

Browse files
authored
Corrected test for internal testing (#2473)
1 parent e9b1fec commit 6b1c463

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchExecutionTest.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,15 @@ public void testSqlServerBulkCopyCachingConnectionLevel() throws Exception {
161161
stmt.execute(createSqlTable1);
162162
stmt.execute(createSqlTable2);
163163

164-
Field bulkcopyMetadataCacheField = TestUtils.getJVMVersion() > 8 ?
165-
con.getClass().getSuperclass().getDeclaredField("BULK_COPY_OPERATION_CACHE") :
166-
con.getClass().getDeclaredField("BULK_COPY_OPERATION_CACHE");
164+
Field bulkcopyMetadataCacheField;
165+
166+
if (con.getClass().getName().equals("com.microsoft.sqlserver.jdbc.SQLServerConnection43")) {
167+
bulkcopyMetadataCacheField = con.getClass().getSuperclass()
168+
.getDeclaredField("BULK_COPY_OPERATION_CACHE");
169+
} else {
170+
bulkcopyMetadataCacheField = con.getClass().getDeclaredField("BULK_COPY_OPERATION_CACHE");
171+
}
172+
167173
bulkcopyMetadataCacheField.setAccessible(true);
168174
Object bulkcopyCache = bulkcopyMetadataCacheField.get(con);
169175

0 commit comments

Comments
 (0)