Skip to content
Open
Show file tree
Hide file tree
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 @@ -1552,7 +1552,6 @@ class BeamModulePlugin implements Plugin<Project> {
"InvalidLink",
"InvalidParam",
"InvalidThrows",
"JavaTimeDefaultTimeZone",
"JavaUtilDate",
"JodaConstructors",
"MalformedInlineTag",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void testTzTimestamp() {

@Test
public void testUtcTimeOnly() {
LocalTime time = LocalTime.now();
LocalTime time = LocalTime.now(ZoneId.of("UTC"));
UTCTimeOnly timeOnly = new UTCTimeOnly();

LocalTime afterConversions = timeOnly.toInputType(timeOnly.toBaseType(time));
Expand All @@ -79,7 +79,7 @@ public void testTzTimeOnly() {

@Test
public void testUtcDateOnly() {
LocalDate date = LocalDate.now();
LocalDate date = LocalDate.now(ZoneId.of("UTC"));
UTCDateOnly dateOnly = new UTCDateOnly();

LocalDate afterConversions = dateOnly.toInputType(dateOnly.toBaseType(date));
Expand All @@ -89,7 +89,7 @@ public void testUtcDateOnly() {

@Test
public void testLocalMktDate() {
LocalDate date = LocalDate.now();
LocalDate date = LocalDate.now(ZoneId.of("UTC"));
LocalMktDate localMktDate = new LocalMktDate();

LocalDate afterConversions = localMktDate.toInputType(localMktDate.toBaseType(date));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.extensions.sql.impl.utils.CalciteUtils;
import org.apache.beam.sdk.schemas.Schema;
Expand Down Expand Up @@ -70,9 +71,9 @@ public void encodeAndDecode() throws Exception {
1.1,
BigDecimal.ZERO,
"hello",
LocalTime.now(),
LocalDate.now(),
LocalDateTime.now(),
LocalTime.now(ZoneId.of("UTC")),
LocalDate.now(ZoneId.of("UTC")),
LocalDateTime.now(ZoneId.of("UTC")),
DateTime.now().toInstant(),
true)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public void beforeClass() {
when(mockedBlobClient.getBlockBlobClient()).thenReturn(mockedBlockBlob);
when(mockedBlobClient.getProperties()).thenReturn(mockedProperties);
when(mockedProperties.getBlobSize()).thenReturn(Long.valueOf(1));
when(mockedProperties.getLastModified()).thenReturn(OffsetDateTime.now());
when(mockedProperties.getLastModified())
.thenReturn(OffsetDateTime.now(java.time.ZoneOffset.UTC));
when(mockedContainerClient.listBlobs(any(ListBlobsOptions.class), any(Duration.class)))
.thenReturn(mockedPagedIterable);
when(mockedContainerClient.listBlobsByHierarchy(any(String.class)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static long refreshIndexAndGetCurrentNumDocs(
static List<String> createDocuments(long numDocs, InjectionMode injectionMode) {

ArrayList<String> data = new ArrayList<>();
LocalDateTime baseDateTime = LocalDateTime.now();
LocalDateTime baseDateTime = LocalDateTime.now(java.time.ZoneOffset.UTC);
for (int i = 0; i < numDocs; i++) {
int index = i % FAMOUS_SCIENTISTS.length;
// insert 2 malformed documents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -253,9 +254,9 @@ public class BeamRowToStorageApiProtoTest {
.withFieldValue("arrayValue", ImmutableList.of("one", "two", "red", "blue"))
.withFieldValue("arrayNullValue", null)
.withFieldValue("iterableValue", ImmutableList.of("blue", "red", "two", "one"))
.withFieldValue("sqlDateValue", LocalDate.now())
.withFieldValue("sqlTimeValue", LocalTime.now())
.withFieldValue("sqlDatetimeValue", LocalDateTime.now())
.withFieldValue("sqlDateValue", LocalDate.now(ZoneId.of("UTC")))
.withFieldValue("sqlTimeValue", LocalTime.now(ZoneId.of("UTC")))
.withFieldValue("sqlDatetimeValue", LocalDateTime.now(ZoneId.of("UTC")))
.withFieldValue("sqlTimestampValue", java.time.Instant.now().plus(123, ChronoUnit.MICROS))
.withFieldValue("enumValue", TEST_ENUM.valueOf("RED"))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static List<String> getMetric(String metric, int number) {
m.addField("field2", random.nextInt(100));
LocalDateTime time =
LocalDateTime.of(
LocalDate.now(),
LocalDate.now(ZoneId.of("America/Los_Angeles")),
LocalTime.of(
random.nextInt(24),
random.nextInt(60),
Expand All @@ -64,7 +64,7 @@ static List<String> getMultipleMetric(List<String> metrics, int number) {
m.addField("field2", random.nextInt(100));
LocalDateTime time =
LocalDateTime.of(
LocalDate.now(),
LocalDate.now(ZoneId.of("America/Los_Angeles")),
LocalTime.of(
random.nextInt(24),
random.nextInt(60),
Expand Down
Loading