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

feat: [eventarcpublishing] Introduce the event publishing using JSON representation of CloudEvents #8730

Merged
merged 2 commits into from
Nov 8, 2022
Merged
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 @@ -62,6 +62,7 @@
* PublishChannelConnectionEventsRequest.newBuilder()
* .setChannelConnection("channelConnection-1932021695")
* .addAllEvents(new ArrayList<Any>())
* .addAllTextEvents(new ArrayList<String>())
* .build();
* PublishChannelConnectionEventsResponse response =
* publisherClient.publishChannelConnectionEvents(request);
Expand Down Expand Up @@ -202,6 +203,7 @@ public PublisherStub getStub() {
* PublishChannelConnectionEventsRequest.newBuilder()
* .setChannelConnection("channelConnection-1932021695")
* .addAllEvents(new ArrayList<Any>())
* .addAllTextEvents(new ArrayList<String>())
* .build();
* PublishChannelConnectionEventsResponse response =
* publisherClient.publishChannelConnectionEvents(request);
Expand Down Expand Up @@ -233,6 +235,7 @@ public final PublishChannelConnectionEventsResponse publishChannelConnectionEven
* PublishChannelConnectionEventsRequest.newBuilder()
* .setChannelConnection("channelConnection-1932021695")
* .addAllEvents(new ArrayList<Any>())
* .addAllTextEvents(new ArrayList<String>())
* .build();
* ApiFuture<PublishChannelConnectionEventsResponse> future =
* publisherClient.publishChannelConnectionEventsCallable().futureCall(request);
Expand Down Expand Up @@ -264,6 +267,7 @@ public final PublishChannelConnectionEventsResponse publishChannelConnectionEven
* PublishEventsRequest.newBuilder()
* .setChannel("channel738950403")
* .addAllEvents(new ArrayList<Any>())
* .addAllTextEvents(new ArrayList<String>())
* .build();
* PublishEventsResponse response = publisherClient.publishEvents(request);
* }
Expand Down Expand Up @@ -293,6 +297,7 @@ public final PublishEventsResponse publishEvents(PublishEventsRequest request) {
* PublishEventsRequest.newBuilder()
* .setChannel("channel738950403")
* .addAllEvents(new ArrayList<Any>())
* .addAllTextEvents(new ArrayList<String>())
* .build();
* ApiFuture<PublishEventsResponse> future =
* publisherClient.publishEventsCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
* PublishChannelConnectionEventsRequest.newBuilder()
* .setChannelConnection("channelConnection-1932021695")
* .addAllEvents(new ArrayList<Any>())
* .addAllTextEvents(new ArrayList<String>())
* .build();
* PublishChannelConnectionEventsResponse response =
* publisherClient.publishChannelConnectionEvents(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public void publishChannelConnectionEventsTest() throws Exception {
.setChannelConnection(
"projects/project-748/locations/location-748/channelConnections/channelConnection-748")
.addAllEvents(new ArrayList<Any>())
.addAllTextEvents(new ArrayList<String>())
.build();

PublishChannelConnectionEventsResponse actualResponse =
Expand Down Expand Up @@ -117,6 +118,7 @@ public void publishChannelConnectionEventsExceptionTest() throws Exception {
.setChannelConnection(
"projects/project-748/locations/location-748/channelConnections/channelConnection-748")
.addAllEvents(new ArrayList<Any>())
.addAllTextEvents(new ArrayList<String>())
.build();
client.publishChannelConnectionEvents(request);
Assert.fail("No exception raised");
Expand All @@ -134,6 +136,7 @@ public void publishEventsTest() throws Exception {
PublishEventsRequest.newBuilder()
.setChannel("projects/project-2616/locations/location-2616/channels/channel-2616")
.addAllEvents(new ArrayList<Any>())
.addAllTextEvents(new ArrayList<String>())
.build();

PublishEventsResponse actualResponse = client.publishEvents(request);
Expand Down Expand Up @@ -166,6 +169,7 @@ public void publishEventsExceptionTest() throws Exception {
PublishEventsRequest.newBuilder()
.setChannel("projects/project-2616/locations/location-2616/channels/channel-2616")
.addAllEvents(new ArrayList<Any>())
.addAllTextEvents(new ArrayList<String>())
.build();
client.publishEvents(request);
Assert.fail("No exception raised");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void publishChannelConnectionEventsTest() throws Exception {
PublishChannelConnectionEventsRequest.newBuilder()
.setChannelConnection("channelConnection-1932021695")
.addAllEvents(new ArrayList<Any>())
.addAllTextEvents(new ArrayList<String>())
.build();

PublishChannelConnectionEventsResponse actualResponse =
Expand All @@ -100,6 +101,7 @@ public void publishChannelConnectionEventsTest() throws Exception {

Assert.assertEquals(request.getChannelConnection(), actualRequest.getChannelConnection());
Assert.assertEquals(request.getEventsList(), actualRequest.getEventsList());
Assert.assertEquals(request.getTextEventsList(), actualRequest.getTextEventsList());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -116,6 +118,7 @@ public void publishChannelConnectionEventsExceptionTest() throws Exception {
PublishChannelConnectionEventsRequest.newBuilder()
.setChannelConnection("channelConnection-1932021695")
.addAllEvents(new ArrayList<Any>())
.addAllTextEvents(new ArrayList<String>())
.build();
client.publishChannelConnectionEvents(request);
Assert.fail("No exception raised");
Expand All @@ -133,6 +136,7 @@ public void publishEventsTest() throws Exception {
PublishEventsRequest.newBuilder()
.setChannel("channel738950403")
.addAllEvents(new ArrayList<Any>())
.addAllTextEvents(new ArrayList<String>())
.build();

PublishEventsResponse actualResponse = client.publishEvents(request);
Expand All @@ -144,6 +148,7 @@ public void publishEventsTest() throws Exception {

Assert.assertEquals(request.getChannel(), actualRequest.getChannel());
Assert.assertEquals(request.getEventsList(), actualRequest.getEventsList());
Assert.assertEquals(request.getTextEventsList(), actualRequest.getTextEventsList());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -160,6 +165,7 @@ public void publishEventsExceptionTest() throws Exception {
PublishEventsRequest.newBuilder()
.setChannel("channel738950403")
.addAllEvents(new ArrayList<Any>())
.addAllTextEvents(new ArrayList<String>())
.build();
client.publishEvents(request);
Assert.fail("No exception raised");
Expand Down
Loading