Skip to content

Commit 5cfcf3f

Browse files
committed
SuppressForbidden
1 parent 4f599ba commit 5cfcf3f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

modules/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobContainerRetriesTests.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,12 @@ public void testUploadNotFoundInCompareAndExchange() {
13501350
final var blobContainerPath = BlobPath.EMPTY.add(getTestName());
13511351
final var statefulBlobContainer = createBlobContainer(1, null, null, null, null, null, blobContainerPath);
13521352

1353-
httpServer.createContext("/", new S3HttpHandler("bucket") {
1353+
@SuppressForbidden(reason = "use a http server")
1354+
class RejectsUploadPartRequests extends S3HttpHandler {
1355+
RejectsUploadPartRequests() {
1356+
super("bucket");
1357+
}
1358+
13541359
@Override
13551360
public void handle(HttpExchange exchange) throws IOException {
13561361
if (parseRequest(exchange).isUploadPartRequest()) {
@@ -1359,7 +1364,9 @@ public void handle(HttpExchange exchange) throws IOException {
13591364
super.handle(exchange);
13601365
}
13611366
}
1362-
});
1367+
}
1368+
1369+
httpServer.createContext("/", new RejectsUploadPartRequests());
13631370

13641371
safeAwait(
13651372
l -> statefulBlobContainer.compareAndExchangeRegister(

0 commit comments

Comments
 (0)