Skip to content

Commit cff2077

Browse files
Define a property for the CloudEvents SDK version to avoid mentioning it three times. (GoogleCloudPlatform#80)
* Update the version of the CloudEvents SDK to 2.0.0RC2. Since the API is hopefully stable now, rename `ExperimentalCloudEventsFunction` to `CloudEventsFunction`. Add support for a `FUNCTION_SIGNATURE_TYPE` of `cloudevent`. Treat it the same as `background`. (We don't really need `FUNCTION_SIGNATURE_TYPE`, since the interface implemented by the function class tells us what the signature is.) Simplify the integration test slightly by removing some intermediary helper methods. * Define a property for the CloudEvents SDK version to avoid mentioning it three times. Also fix the import order in a couple of source files. * Define a property for the CloudEvents SDK version to avoid mentioning it three times. Also fix the import order in a couple of source files.
1 parent 14b4dc3 commit cff2077

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

invoker/core/pom.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<junit.jupiter.version>5.3.2</junit.jupiter.version>
2323
<maven.compiler.source>11</maven.compiler.source>
2424
<maven.compiler.target>11</maven.compiler.target>
25+
<cloudevents.sdk.version>2.0.0.RC2</cloudevents.sdk.version>
2526
</properties>
2627

2728
<licenses>
@@ -52,17 +53,17 @@
5253
<dependency>
5354
<groupId>io.cloudevents</groupId>
5455
<artifactId>cloudevents-core</artifactId>
55-
<version>2.0.0.RC2</version>
56+
<version>${cloudevents.sdk.version}</version>
5657
</dependency>
5758
<dependency>
5859
<groupId>io.cloudevents</groupId>
5960
<artifactId>cloudevents-http-basic</artifactId>
60-
<version>2.0.0.RC2</version>
61+
<version>${cloudevents.sdk.version}</version>
6162
</dependency>
6263
<dependency>
6364
<groupId>io.cloudevents</groupId>
6465
<artifactId>cloudevents-json-jackson</artifactId>
65-
<version>2.0.0.RC2</version>
66+
<version>${cloudevents.sdk.version}</version>
6667
</dependency>
6768
<dependency>
6869
<groupId>com.google.code.gson</groupId>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static java.util.stream.Collectors.toMap;
2020

2121
import com.google.cloud.functions.BackgroundFunction;
22+
import com.google.cloud.functions.CloudEventsFunction;
2223
import com.google.cloud.functions.Context;
2324
import com.google.cloud.functions.RawBackgroundFunction;
2425
import com.google.gson.Gson;
@@ -45,7 +46,6 @@
4546
import javax.servlet.http.HttpServlet;
4647
import javax.servlet.http.HttpServletRequest;
4748
import javax.servlet.http.HttpServletResponse;
48-
import com.google.cloud.functions.CloudEventsFunction;
4949

5050
/** Executes the user's background function. */
5151
public final class BackgroundFunctionExecutor extends HttpServlet {

invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/CloudEventSnoop.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
import static java.nio.charset.StandardCharsets.UTF_8;
44

5+
import com.google.cloud.functions.CloudEventsFunction;
56
import com.google.gson.Gson;
67
import com.google.gson.JsonObject;
78
import io.cloudevents.CloudEvent;
89
import io.cloudevents.core.format.EventFormat;
910
import io.cloudevents.core.provider.EventFormatProvider;
1011
import io.cloudevents.jackson.JsonFormat;
1112
import java.io.FileOutputStream;
12-
import com.google.cloud.functions.CloudEventsFunction;
1313

1414
public class CloudEventSnoop implements CloudEventsFunction {
1515
@Override

0 commit comments

Comments
 (0)