Skip to content

armgit / floci

Public Imported from GitHub
0

Light, fluffy, and always free - The AWS Local Emulator alternative

fix(s3): include EventBridgeConfiguration in GetBucketNotification response (#2072)

Ron Yehudab8edd37b0c9f
diff --git a/src/main/java/io/github/hectorvent/floci/services/s3/S3Controller.java b/src/main/java/io/github/hectorvent/floci/services/s3/S3Controller.java
index fdf2aa88b6..64fb3e6c30 100644
--- a/src/main/java/io/github/hectorvent/floci/services/s3/S3Controller.java
+++ b/src/main/java/io/github/hectorvent/floci/services/s3/S3Controller.java
@@ -1438,6 +1438,9 @@ public class S3Controller {
appendFilterRules(xml, ln.filterRules());
xml.end("CloudFunctionConfiguration");
}
+ if (config.isEventBridgeEnabled()) {
+ xml.start("EventBridgeConfiguration").end("EventBridgeConfiguration");
+ }
xml.end("NotificationConfiguration");
return Response.ok(xml.build()).type(MediaType.APPLICATION_XML).build();
} catch (AwsException e) {
diff --git a/src/test/java/io/github/hectorvent/floci/services/s3/S3EventBridgeIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/s3/S3EventBridgeIntegrationTest.java
index 991440ff5f..f228f73104 100644
--- a/src/test/java/io/github/hectorvent/floci/services/s3/S3EventBridgeIntegrationTest.java
+++ b/src/test/java/io/github/hectorvent/floci/services/s3/S3EventBridgeIntegrationTest.java
@@ -115,6 +115,13 @@ class S3EventBridgeIntegrationTest {
.put("/eb-s3-test-bucket?notification")
.then()
.statusCode(200);
+
+ given()
+ .when()
+ .get("/eb-s3-test-bucket?notification")
+ .then()
+ .statusCode(200)
+ .body(containsString("<EventBridgeConfiguration"));
}
@Test
@@ -185,6 +192,13 @@ class S3EventBridgeIntegrationTest {
.then()
.statusCode(200);
+ given()
+ .when()
+ .get("/eb-s3-test-bucket?notification")
+ .then()
+ .statusCode(200)
+ .body(not(containsString("EventBridgeConfiguration")));
+
// Drain any leftover messages
given()
.contentType("application/x-www-form-urlencoded")