Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1ca4d06

Browse files
authoredSep 3, 2020
Update to Milestone 2 of the CloudEvents SDK. (GoogleCloudPlatform#56)
Temporarily switch the Functions Framework to use a SNAPSHOT version of the API.
1 parent a114c01 commit 1ca4d06

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed
 

‎functions-framework-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<dependency>
5353
<groupId>io.cloudevents</groupId>
5454
<artifactId>cloudevents-api</artifactId>
55-
<version>2.0.0-milestone1</version>
55+
<version>2.0.0-milestone2</version>
5656
</dependency>
5757
</dependencies>
5858

‎invoker/core/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
<dependency>
5353
<groupId>io.cloudevents</groupId>
5454
<artifactId>cloudevents-api</artifactId>
55-
<version>2.0.0-milestone1</version>
55+
<version>2.0.0-milestone2</version>
5656
</dependency>
5757
<dependency>
5858
<groupId>io.cloudevents</groupId>
5959
<artifactId>cloudevents-core</artifactId>
60-
<version>2.0.0-milestone1</version>
60+
<version>2.0.0-milestone2</version>
6161
</dependency>
6262
<dependency>
6363
<groupId>io.cloudevents</groupId>
6464
<artifactId>cloudevents-json-jackson</artifactId>
65-
<version>2.0.0-milestone1</version>
65+
<version>2.0.0-milestone2</version>
6666
</dependency>
6767
<dependency>
6868
<groupId>com.google.code.gson</groupId>

‎invoker/core/src/main/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package com.google.cloud.functions.invoker;
1616

1717
import static java.nio.charset.StandardCharsets.UTF_8;
18-
import static java.util.stream.Collectors.joining;
1918
import static java.util.stream.Collectors.toMap;
2019

2120
import com.google.cloud.functions.BackgroundFunction;
@@ -32,7 +31,7 @@
3231
import java.io.BufferedReader;
3332
import java.io.IOException;
3433
import java.lang.reflect.Type;
35-
import java.time.ZonedDateTime;
34+
import java.time.OffsetDateTime;
3635
import java.time.format.DateTimeFormatter;
3736
import java.util.Arrays;
3837
import java.util.Collections;
@@ -132,7 +131,7 @@ private static Event parseLegacyEvent(HttpServletRequest req) throws IOException
132131
}
133132

134133
private static Context contextFromCloudEvent(CloudEvent cloudEvent) {
135-
ZonedDateTime timestamp = Optional.ofNullable(cloudEvent.getTime()).orElse(ZonedDateTime.now());
134+
OffsetDateTime timestamp = Optional.ofNullable(cloudEvent.getTime()).orElse(OffsetDateTime.now());
136135
String timestampString = DateTimeFormatter.ISO_INSTANT.format(timestamp);
137136
// We don't have an obvious replacement for the Context.resource field, which with legacy events
138137
// corresponded to a value present for some proprietary Google event types.

‎invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
import java.nio.file.Files;
5252
import java.nio.file.Path;
5353
import java.nio.file.Paths;
54+
import java.time.OffsetDateTime;
5455
import java.time.ZoneOffset;
55-
import java.time.ZonedDateTime;
5656
import java.util.Arrays;
5757
import java.util.List;
5858
import java.util.Map;
@@ -121,7 +121,7 @@ private static CloudEvent sampleCloudEvent(File snoopFile) {
121121
.withDataSchema(URI.create("/schema"))
122122
.withDataContentType("application/json")
123123
.withData(("{\"a\": 2, \"b\": 3, \"targetFile\": \"" + snoopFile + "\"}").getBytes(UTF_8))
124-
.withTime(ZonedDateTime.of(2018, 4, 5, 17, 31, 0, 0, ZoneOffset.UTC))
124+
.withTime(OffsetDateTime.of(2018, 4, 5, 17, 31, 0, 0, ZoneOffset.UTC))
125125
.build();
126126
}
127127

‎invoker/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<dependency>
4343
<groupId>com.google.cloud.functions</groupId>
4444
<artifactId>functions-framework-api</artifactId>
45-
<version>1.0.2</version>
45+
<version>1.0.3-SNAPSHOT</version>
4646
</dependency>
4747
</dependencies>
4848
</dependencyManagement>

0 commit comments

Comments
 (0)
Please sign in to comment.