Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test | Fix usage of Deprecated API in BatchExecutionWithBulkCopyTest #1006

Merged
merged 1 commit into from
Mar 29, 2019
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 @@ -21,6 +21,7 @@
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -77,10 +78,13 @@ private Object[] generateExpectedValues() {
// Datetime can only end in 0,3,7 and will be rounded to those numbers on the server. Manually set nanos
Timestamp roundedDatetime = randomTimestamp;
roundedDatetime.setNanos(0);

// Smalldatetime does not have seconds. Manually set nanos and seconds.
Timestamp smallTimestamp = randomTimestamp;
smallTimestamp.setNanos(0);
smallTimestamp.setSeconds(0);
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(randomTimestamp.getTime());
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
Timestamp smallTimestamp = new Timestamp(cal.getTimeInMillis());

Object[] expected = new Object[23];
expected[0] = Constants.RANDOM.nextLong();
Expand Down