Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,10 @@ private void validate(
}

private void validateNull(
String method, BiFunction<ResultSet, Integer, Object> getter, Object expectedDefaultValue)
String method,
BiFunction<ResultSet, Integer, Object> getter,
ImmutableMap<String, Object> expectedResult,
Object expectedDefaultValue)
throws Exception {

try (Connection connection = DriverManager.getConnection(connection_uri);
Expand All @@ -2533,7 +2536,7 @@ private void validateNull(

for (int i = 1; i <= resultSetRegular.getMetaData().getColumnCount(); i++) {
String columnName = resultSetRegular.getMetaData().getColumnName(i);
if (!columnName.contains("array")) {
if (!columnName.contains("array") && expectedResult.containsKey(columnName)) {
Comment thread
Neenu1995 marked this conversation as resolved.
Resolved
String regularApiLabel =
String.format(
"[Method: %s] [Column: %s] [API: Regular] [Null Scenario]", method, columnName);
Expand Down Expand Up @@ -2608,7 +2611,7 @@ public void validateGetString() throws Exception {
}
};
validate("getString", getter, stringResults);
validateNull("getString", getter, null);
validateNull("getString", getter, stringResults, null);
}

@Test
Expand All @@ -2629,7 +2632,7 @@ public void validateGetInt() throws Exception {
}
};
validate("getInt", getter, result);
validateNull("getInt", getter, 0);
validateNull("getInt", getter, result, 0);
}

@Test
Expand All @@ -2650,7 +2653,7 @@ public void validateGetLong() throws Exception {
}
};
validate("getLong", getter, result);
validateNull("getLong", getter, 0L);
validateNull("getLong", getter, result, 0L);
}

@Test
Expand All @@ -2673,7 +2676,7 @@ public void validateGetBool() throws Exception {
}
};
validate("getBool", getter, result);
validateNull("getBool", getter, false);
validateNull("getBool", getter, result, false);
}

@Test
Expand All @@ -2695,7 +2698,7 @@ public void validateGetFloat() throws Exception {
}
};
validate("getFloat", getter, result);
validateNull("getFloat", getter, 0.0f);
validateNull("getFloat", getter, result, 0.0f);
}

@Test
Expand All @@ -2717,7 +2720,7 @@ public void validateGetDouble() throws Exception {
}
};
validate("getDouble", getter, result);
validateNull("getDouble", getter, 0.0d);
validateNull("getDouble", getter, result, 0.0d);
}

@Test
Expand All @@ -2738,7 +2741,7 @@ public void validateGetShort() throws Exception {
}
};
validate("getShort", getter, result);
validateNull("getShort", getter, (short) 0);
validateNull("getShort", getter, result, (short) 0);
}

@Test
Expand All @@ -2760,7 +2763,7 @@ public void validateGetTime() throws Exception {
}
};
validate("getTime", getter, result);
validateNull("getTime", getter, null);
validateNull("getTime", getter, result, null);
}

@Test
Expand All @@ -2780,7 +2783,7 @@ public void validateGetDate() throws Exception {
}
};
validate("getDate", getter, result);
validateNull("getDate", getter, null);
validateNull("getDate", getter, result, null);
}

@Test
Expand All @@ -2801,7 +2804,7 @@ public void validateGetTimestamp() throws Exception {
}
};
validate("getTimestamp", getter, result);
validateNull("getTimestamp", getter, null);
validateNull("getTimestamp", getter, result, null);
}

@Test
Expand All @@ -2821,7 +2824,7 @@ public void validateGetByte() throws Exception {
}
};
validate("getByte", getter, result);
validateNull("getByte", getter, (byte) 0);
validateNull("getByte", getter, result, (byte) 0);
}

@Test
Expand Down
Loading