mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
feat(s3): add Intelligent-Tiering configuration CRUD (#2997)
* feat(s3): add Intelligent-Tiering configuration CRUD Add AWS S3 Intelligent-Tiering configuration management through the real REST XML subresource (?intelligent-tiering), mirroring the existing metrics configuration pattern. Operations: - PutBucketIntelligentTieringConfiguration (PUT, 204) - GetBucketIntelligentTieringConfiguration (GET by id) - ListBucketIntelligentTieringConfigurations (GET without id) - DeleteBucketIntelligentTieringConfiguration (DELETE, 204) The parser validates Id, Status (Enabled/Disabled), optional Filter (Prefix/Tag/And), and one or more Tiering entries (AccessTier + positive Days), re-serializing through XmlBuilder/XmlParser/AwsNamespaces.S3 so responses are built by floci rather than echoing the request body. Malformed bodies return MalformedXML; missing configurations return NoSuchConfiguration. Configurations are stored on the Bucket model keyed by id (nullable map for backward-compatible deserialization of older snapshots), persisted through StorageFactory, and synchronized on the bucket monitor with the same requireSameRecord guard as metrics to survive concurrent puts and bucket delete/recreate races. Tests: - S3IntelligentTieringConfigurationTest: parser unit tests - S3ServiceTest: service lifecycle, isolation, persistence, concurrency - S3IntelligentTieringConfigurationIntegrationTest: REST integration - compatibility-tests/sdk-test-awscli: AWS CLI bats coverage * refactor(s3): rename METRICS_XML_DECLARATION to S3_XML_DECLARATION The XML declaration constant is shared by both metrics and intelligent-tiering configuration responses, so the name should reflect its S3-wide scope rather than implying it is metrics-specific. * fix(s3): enforce auth and validate Days overflow on intelligent-tiering Address review feedback on PR #2997: - PUT and DELETE ?intelligent-tiering now enforce S3 authorization via a new authorizeBucketWrite method, closing the bypass where mutations skipped the auth applied to reads. - Days values above Integer.MAX_VALUE no longer throw NumberFormatException and return 500 InternalError; they are rejected as 400 MalformedXML. - A PUT without a request body returns 400 MalformedXML instead of NPE/500. Tests: unit coverage for Days overflow, integration coverage for empty body. * fix(s3): enforce tier-specific Days range on intelligent-tiering AWS enforces a tier-specific Days range for S3 Intelligent-Tiering: - ARCHIVE_ACCESS: 90 to 730 days - DEEP_ARCHIVE_ACCESS: 180 to 730 days Out-of-range values now return InvalidArgument with ArgumentName and ArgumentValue in the XML error body, matching the real S3 error shape. Add unit and integration tests covering below-minimum, above-maximum, boundary acceptance, and the full XML error response. * refactor(s3): extract Days range constants in intelligent-tiering Replace repeated magic numbers (90, 180, 730) with named constants ARCHIVE_ACCESS_MIN_DAYS, DEEP_ARCHIVE_ACCESS_MIN_DAYS, and MAX_DAYS. Pass min into daysOutOfRange instead of recomputing it, and use an import for LinkedHashMap.
This commit is contained in:
1 parent
c55733c49e
commit
96d16de998
9 files changed
+1314
-9
No files matched your search
+411
@@ -0,0 +1,411 @@
|
||||
package io.github.hectorvent.floci.services.s3;
|
||||
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import static io.restassured.RestAssured.given;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
|
||||
@QuarkusTest
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
class S3IntelligentTieringConfigurationIntegrationTest {
|
||||
|
||||
private static final String BUCKET = "intelligent-tiering-int-test";
|
||||
|
||||
@Test
|
||||
@Order(1)
|
||||
void createBucket() {
|
||||
given()
|
||||
.when()
|
||||
.put("/" + BUCKET)
|
||||
.then()
|
||||
.statusCode(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* An unhandled {@code PUT /{bucket}?intelligent-tiering} would fall through to the
|
||||
* unqualified {@code CreateBucket} and answer BucketAlreadyOwnedByYou. Real S3 stores the
|
||||
* configuration and returns 204.
|
||||
*/
|
||||
@Test
|
||||
@Order(2)
|
||||
void putIntelligentTieringConfigurationIsNotTreatedAsCreateBucket() {
|
||||
given()
|
||||
.body("""
|
||||
<IntelligentTieringConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||
<Id>EntireBucket</Id>
|
||||
<Status>Enabled</Status>
|
||||
<Tiering>
|
||||
<AccessTier>ARCHIVE_ACCESS</AccessTier>
|
||||
<Days>90</Days>
|
||||
</Tiering>
|
||||
</IntelligentTieringConfiguration>
|
||||
""")
|
||||
.when()
|
||||
.put("/" + BUCKET + "?intelligent-tiering&id=EntireBucket")
|
||||
.then()
|
||||
.statusCode(204)
|
||||
.body(not(containsString("BucketAlreadyOwnedByYou")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(3)
|
||||
void getIntelligentTieringConfigurationReturnsWhatWasStored() {
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?intelligent-tiering&id=EntireBucket")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<IntelligentTieringConfiguration"))
|
||||
.body(containsString("<Id>EntireBucket</Id>"))
|
||||
.body(containsString("<Status>Enabled</Status>"))
|
||||
.body(containsString("<AccessTier>ARCHIVE_ACCESS</AccessTier>"))
|
||||
.body(containsString("<Days>90</Days>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(4)
|
||||
void putFilteredConfigurationKeepsTheFilterAndEveryTiering() {
|
||||
given()
|
||||
.body("""
|
||||
<IntelligentTieringConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||
<Id>Filtered</Id>
|
||||
<Filter>
|
||||
<And>
|
||||
<Prefix>logs/</Prefix>
|
||||
<Tag><Key>env</Key><Value>prod</Value></Tag>
|
||||
<Tag><Key>team</Key><Value>core</Value></Tag>
|
||||
</And>
|
||||
</Filter>
|
||||
<Status>Disabled</Status>
|
||||
<Tiering>
|
||||
<AccessTier>ARCHIVE_ACCESS</AccessTier>
|
||||
<Days>90</Days>
|
||||
</Tiering>
|
||||
<Tiering>
|
||||
<AccessTier>DEEP_ARCHIVE_ACCESS</AccessTier>
|
||||
<Days>180</Days>
|
||||
</Tiering>
|
||||
</IntelligentTieringConfiguration>
|
||||
""")
|
||||
.when()
|
||||
.put("/" + BUCKET + "?intelligent-tiering&id=Filtered")
|
||||
.then()
|
||||
.statusCode(204);
|
||||
|
||||
// AWS repeats <Tag> inside <And> with no wrapping element.
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?intelligent-tiering&id=Filtered")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<And><Prefix>logs/</Prefix>"
|
||||
+ "<Tag><Key>env</Key><Value>prod</Value></Tag>"
|
||||
+ "<Tag><Key>team</Key><Value>core</Value></Tag></And>"))
|
||||
.body(containsString("<Status>Disabled</Status>"))
|
||||
.body(containsString("<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier>"
|
||||
+ "<Days>90</Days></Tiering>"
|
||||
+ "<Tiering><AccessTier>DEEP_ARCHIVE_ACCESS</AccessTier>"
|
||||
+ "<Days>180</Days></Tiering>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(5)
|
||||
void listWithoutAnIdReturnsEveryConfiguration() {
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?intelligent-tiering")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<ListBucketIntelligentTieringConfigurationsResult"))
|
||||
.body(containsString("<Id>EntireBucket</Id>"))
|
||||
.body(containsString("<Id>Filtered</Id>"))
|
||||
.body(containsString("<IsTruncated>false</IsTruncated>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(6)
|
||||
void puttingTheSameIdReplacesRatherThanDuplicates() {
|
||||
given()
|
||||
.body("""
|
||||
<IntelligentTieringConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||
<Id>EntireBucket</Id>
|
||||
<Status>Disabled</Status>
|
||||
<Tiering>
|
||||
<AccessTier>DEEP_ARCHIVE_ACCESS</AccessTier>
|
||||
<Days>180</Days>
|
||||
</Tiering>
|
||||
</IntelligentTieringConfiguration>
|
||||
""")
|
||||
.when()
|
||||
.put("/" + BUCKET + "?intelligent-tiering&id=EntireBucket")
|
||||
.then()
|
||||
.statusCode(204);
|
||||
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?intelligent-tiering&id=EntireBucket")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<Status>Disabled</Status>"))
|
||||
.body(containsString("<Days>180</Days>"));
|
||||
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?intelligent-tiering")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<Id>EntireBucket</Id>"))
|
||||
.body(containsString("<Id>Filtered</Id>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(7)
|
||||
void idInTheBodyMustMatchTheIdInTheQuery() {
|
||||
given()
|
||||
.body("""
|
||||
<IntelligentTieringConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||
<Id>Different</Id>
|
||||
<Status>Enabled</Status>
|
||||
<Tiering>
|
||||
<AccessTier>ARCHIVE_ACCESS</AccessTier>
|
||||
<Days>90</Days>
|
||||
</Tiering>
|
||||
</IntelligentTieringConfiguration>
|
||||
""")
|
||||
.when()
|
||||
.put("/" + BUCKET + "?intelligent-tiering&id=Mismatch")
|
||||
.then()
|
||||
.statusCode(400)
|
||||
.body(containsString("MalformedXML"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(8)
|
||||
void unknownIdIsNotFound() {
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?intelligent-tiering&id=absent")
|
||||
.then()
|
||||
.statusCode(404)
|
||||
.body(containsString("NoSuchConfiguration"));
|
||||
|
||||
// AWS does not treat deleting an absent configuration as a no-op.
|
||||
given()
|
||||
.when()
|
||||
.delete("/" + BUCKET + "?intelligent-tiering&id=absent")
|
||||
.then()
|
||||
.statusCode(404)
|
||||
.body(containsString("NoSuchConfiguration"));
|
||||
}
|
||||
|
||||
/**
|
||||
* An unhandled {@code DELETE /{bucket}?intelligent-tiering} would fall through to the
|
||||
* unqualified {@code DeleteBucket} and silently remove the whole bucket, reporting success.
|
||||
*/
|
||||
@Test
|
||||
@Order(9)
|
||||
void deleteIntelligentTieringConfigurationDoesNotDeleteBucket() {
|
||||
given()
|
||||
.when()
|
||||
.delete("/" + BUCKET + "?intelligent-tiering&id=EntireBucket")
|
||||
.then()
|
||||
.statusCode(204);
|
||||
|
||||
// The bucket, and every other configuration on it, must survive.
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?intelligent-tiering&id=Filtered")
|
||||
.then()
|
||||
.statusCode(200);
|
||||
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?intelligent-tiering&id=EntireBucket")
|
||||
.then()
|
||||
.statusCode(404);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(10)
|
||||
void aRequestWithoutAnIdIsRefusedRatherThanGuessedAt() {
|
||||
given()
|
||||
.body("""
|
||||
<IntelligentTieringConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||
<Id>EntireBucket</Id>
|
||||
<Status>Enabled</Status>
|
||||
<Tiering>
|
||||
<AccessTier>ARCHIVE_ACCESS</AccessTier>
|
||||
<Days>90</Days>
|
||||
</Tiering>
|
||||
</IntelligentTieringConfiguration>
|
||||
""")
|
||||
.when()
|
||||
.put("/" + BUCKET + "?intelligent-tiering")
|
||||
.then()
|
||||
.statusCode(400)
|
||||
.body(containsString("InvalidArgument"));
|
||||
|
||||
given()
|
||||
.when()
|
||||
.delete("/" + BUCKET + "?intelligent-tiering")
|
||||
.then()
|
||||
.statusCode(400)
|
||||
.body(containsString("InvalidArgument"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(11)
|
||||
void malformedBodiesLeaveExistingConfigurationsUnchanged() {
|
||||
given()
|
||||
.body("""
|
||||
<IntelligentTieringConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||
<Id>Filtered</Id>
|
||||
<Status>Maybe</Status>
|
||||
</IntelligentTieringConfiguration>
|
||||
""")
|
||||
.when()
|
||||
.put("/" + BUCKET + "?intelligent-tiering&id=Filtered")
|
||||
.then()
|
||||
.statusCode(400)
|
||||
.body(containsString("MalformedXML"));
|
||||
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?intelligent-tiering&id=Filtered")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<Status>Disabled</Status>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(12)
|
||||
void aPutWithoutABodyIsMalformedXml() {
|
||||
given()
|
||||
.when()
|
||||
.put("/" + BUCKET + "?intelligent-tiering&id=Filtered")
|
||||
.then()
|
||||
.statusCode(400)
|
||||
.body(containsString("MalformedXML"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(13)
|
||||
void unqualifiedDeleteStillRemovesBucket() {
|
||||
given()
|
||||
.when()
|
||||
.delete("/" + BUCKET)
|
||||
.then()
|
||||
.statusCode(204);
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?intelligent-tiering")
|
||||
.then()
|
||||
.statusCode(404)
|
||||
.body(containsString("NoSuchBucket"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(14)
|
||||
void aRecreatedBucketDoesNotInheritTheOldConfigurations() {
|
||||
given()
|
||||
.when()
|
||||
.put("/" + BUCKET)
|
||||
.then()
|
||||
.statusCode(200);
|
||||
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?intelligent-tiering&id=Filtered")
|
||||
.then()
|
||||
.statusCode(404)
|
||||
.body(containsString("NoSuchConfiguration"));
|
||||
|
||||
given()
|
||||
.when()
|
||||
.delete("/" + BUCKET)
|
||||
.then()
|
||||
.statusCode(204);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(15)
|
||||
void outOfRangeDaysReturnsInvalidArgumentWithArgumentNameAndValue() {
|
||||
given()
|
||||
.when()
|
||||
.put("/" + BUCKET)
|
||||
.then()
|
||||
.statusCode(200);
|
||||
|
||||
// ARCHIVE_ACCESS requires at least 90 days; AWS answers InvalidArgument with ArgumentName
|
||||
// and ArgumentValue so the SDK can surface which input was rejected.
|
||||
given()
|
||||
.body("""
|
||||
<IntelligentTieringConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||
<Id>TooFewDays</Id>
|
||||
<Status>Enabled</Status>
|
||||
<Tiering>
|
||||
<AccessTier>ARCHIVE_ACCESS</AccessTier>
|
||||
<Days>1</Days>
|
||||
</Tiering>
|
||||
</IntelligentTieringConfiguration>
|
||||
""")
|
||||
.when()
|
||||
.put("/" + BUCKET + "?intelligent-tiering&id=TooFewDays")
|
||||
.then()
|
||||
.statusCode(400)
|
||||
.body(containsString("InvalidArgument"))
|
||||
.body(containsString("<ArgumentName>Tiering.Days</ArgumentName>"))
|
||||
.body(containsString("<ArgumentValue>1</ArgumentValue>"));
|
||||
|
||||
// DEEP_ARCHIVE_ACCESS requires at least 180 days; 90 is valid for ARCHIVE_ACCESS but not here.
|
||||
given()
|
||||
.body("""
|
||||
<IntelligentTieringConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||
<Id>TooFewDays</Id>
|
||||
<Status>Enabled</Status>
|
||||
<Tiering>
|
||||
<AccessTier>DEEP_ARCHIVE_ACCESS</AccessTier>
|
||||
<Days>90</Days>
|
||||
</Tiering>
|
||||
</IntelligentTieringConfiguration>
|
||||
""")
|
||||
.when()
|
||||
.put("/" + BUCKET + "?intelligent-tiering&id=TooFewDays")
|
||||
.then()
|
||||
.statusCode(400)
|
||||
.body(containsString("InvalidArgument"))
|
||||
.body(containsString("<ArgumentName>Tiering.Days</ArgumentName>"))
|
||||
.body(containsString("<ArgumentValue>90</ArgumentValue>"));
|
||||
|
||||
// Both tiers are capped at 730 days.
|
||||
given()
|
||||
.body("""
|
||||
<IntelligentTieringConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||
<Id>TooManyDays</Id>
|
||||
<Status>Enabled</Status>
|
||||
<Tiering>
|
||||
<AccessTier>ARCHIVE_ACCESS</AccessTier>
|
||||
<Days>731</Days>
|
||||
</Tiering>
|
||||
</IntelligentTieringConfiguration>
|
||||
""")
|
||||
.when()
|
||||
.put("/" + BUCKET + "?intelligent-tiering&id=TooManyDays")
|
||||
.then()
|
||||
.statusCode(400)
|
||||
.body(containsString("InvalidArgument"))
|
||||
.body(containsString("<ArgumentName>Tiering.Days</ArgumentName>"))
|
||||
.body(containsString("<ArgumentValue>731</ArgumentValue>"));
|
||||
|
||||
given()
|
||||
.when()
|
||||
.delete("/" + BUCKET)
|
||||
.then()
|
||||
.statusCode(204);
|
||||
}
|
||||
}
|
||||
+302
@@ -0,0 +1,302 @@
|
||||
package io.github.hectorvent.floci.services.s3;
|
||||
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
class S3IntelligentTieringConfigurationTest {
|
||||
|
||||
private static final String NS = "http://s3.amazonaws.com/doc/2006-03-01/";
|
||||
|
||||
private static String body(String inner) {
|
||||
return "<IntelligentTieringConfiguration xmlns=\"" + NS + "\">" + inner
|
||||
+ "</IntelligentTieringConfiguration>";
|
||||
}
|
||||
|
||||
private static String tiering(String accessTier, int days) {
|
||||
return "<Tiering><AccessTier>" + accessTier + "</AccessTier><Days>" + days + "</Days></Tiering>";
|
||||
}
|
||||
|
||||
@Test
|
||||
void parsesAMinimalConfiguration() {
|
||||
S3IntelligentTieringConfiguration parsed = S3IntelligentTieringConfiguration.parse(
|
||||
body("<Id>EntireBucket</Id><Status>Enabled</Status>" + tiering("ARCHIVE_ACCESS", 90)));
|
||||
|
||||
assertEquals("EntireBucket", parsed.id());
|
||||
assertEquals("<Id>EntireBucket</Id><Status>Enabled</Status>"
|
||||
+ "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier><Days>90</Days></Tiering>",
|
||||
parsed.innerXml());
|
||||
}
|
||||
|
||||
@Test
|
||||
void parsesMultipleTieringsInOrder() {
|
||||
String parsed = S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Disabled</Status>"
|
||||
+ tiering("ARCHIVE_ACCESS", 90)
|
||||
+ tiering("DEEP_ARCHIVE_ACCESS", 180))).innerXml();
|
||||
|
||||
assertEquals("<Id>a</Id><Status>Disabled</Status>"
|
||||
+ "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier><Days>90</Days></Tiering>"
|
||||
+ "<Tiering><AccessTier>DEEP_ARCHIVE_ACCESS</AccessTier><Days>180</Days></Tiering>",
|
||||
parsed);
|
||||
}
|
||||
|
||||
@Test
|
||||
void parsesEachSingleFilterPredicate() {
|
||||
assertEquals("<Id>a</Id><Filter><Prefix>logs/</Prefix></Filter><Status>Enabled</Status>"
|
||||
+ "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier><Days>90</Days></Tiering>",
|
||||
S3IntelligentTieringConfiguration.parse(body("<Id>a</Id>"
|
||||
+ "<Filter><Prefix>logs/</Prefix></Filter><Status>Enabled</Status>"
|
||||
+ tiering("ARCHIVE_ACCESS", 90))).innerXml());
|
||||
|
||||
assertEquals("<Id>a</Id><Filter><Tag><Key>env</Key><Value>prod</Value></Tag></Filter>"
|
||||
+ "<Status>Enabled</Status>"
|
||||
+ "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier><Days>90</Days></Tiering>",
|
||||
S3IntelligentTieringConfiguration.parse(body("<Id>a</Id>"
|
||||
+ "<Filter><Tag><Key>env</Key><Value>prod</Value></Tag></Filter>"
|
||||
+ "<Status>Enabled</Status>" + tiering("ARCHIVE_ACCESS", 90))).innerXml());
|
||||
}
|
||||
|
||||
@Test
|
||||
void parsesAnAndConjunctionKeepingEveryTag() {
|
||||
// IntelligentTieringAndOperator.Tags is a flattened list named Tag, so the tags repeat
|
||||
// with no wrapping element and all of them have to survive the round trip.
|
||||
String parsed = S3IntelligentTieringConfiguration.parse(body("""
|
||||
<Id>a</Id>
|
||||
<Filter>
|
||||
<And>
|
||||
<Prefix>logs/</Prefix>
|
||||
<Tag><Key>env</Key><Value>prod</Value></Tag>
|
||||
<Tag><Key>team</Key><Value>core</Value></Tag>
|
||||
</And>
|
||||
</Filter>
|
||||
<Status>Enabled</Status>
|
||||
""" + tiering("ARCHIVE_ACCESS", 90))).innerXml();
|
||||
|
||||
assertEquals("<Id>a</Id><Filter><And><Prefix>logs/</Prefix>"
|
||||
+ "<Tag><Key>env</Key><Value>prod</Value></Tag>"
|
||||
+ "<Tag><Key>team</Key><Value>core</Value></Tag></And></Filter>"
|
||||
+ "<Status>Enabled</Status>"
|
||||
+ "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier><Days>90</Days></Tiering>", parsed);
|
||||
}
|
||||
|
||||
@Test
|
||||
void escapesValuesOnTheWayBackOut() {
|
||||
String parsed = S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a&b</Id><Filter><Prefix>x<y</Prefix></Filter><Status>Enabled</Status>"
|
||||
+ tiering("ARCHIVE_ACCESS", 90))).innerXml();
|
||||
|
||||
assertEquals("<Id>a&b</Id><Filter><Prefix>x<y</Prefix></Filter>"
|
||||
+ "<Status>Enabled</Status>"
|
||||
+ "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier><Days>90</Days></Tiering>", parsed);
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsBodiesThatDoNotMatchTheSchema() {
|
||||
// Missing id, missing status, missing tiering, wrong root element, empty and non-XML
|
||||
// bodies are all MalformedXML on AWS.
|
||||
for (String invalid : new String[]{
|
||||
body(""),
|
||||
body("<Id> </Id><Status>Enabled</Status>" + tiering("ARCHIVE_ACCESS", 90)),
|
||||
body("<Status>Enabled</Status>" + tiering("ARCHIVE_ACCESS", 90)),
|
||||
body("<Id>a</Id>" + tiering("ARCHIVE_ACCESS", 90)),
|
||||
body("<Id>a</Id><Status>Enabled</Status>"),
|
||||
"<SomethingElse><Id>a</Id></SomethingElse>",
|
||||
"not xml at all",
|
||||
""}) {
|
||||
AwsException e = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(invalid),
|
||||
() -> "expected rejection of: " + invalid);
|
||||
assertEquals("MalformedXML", e.getErrorCode());
|
||||
assertEquals(400, e.getHttpStatus());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsStatusesOutsideTheEnum() {
|
||||
for (String status : new String[]{"enabled", "ENABLED", "Suspended", ""}) {
|
||||
AwsException e = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>" + status + "</Status>" + tiering("ARCHIVE_ACCESS", 90))),
|
||||
() -> "expected rejection of status: " + status);
|
||||
assertEquals("MalformedXML", e.getErrorCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsTieringsOutsideTheSchema() {
|
||||
String unknownAccessTier = "<Tiering><AccessTier>GLACIER</AccessTier><Days>90</Days></Tiering>";
|
||||
String missingDays = "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier></Tiering>";
|
||||
String missingAccessTier = "<Tiering><Days>90</Days></Tiering>";
|
||||
String zeroDays = "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier><Days>0</Days></Tiering>";
|
||||
String nonNumericDays = "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier><Days>soon</Days></Tiering>";
|
||||
|
||||
for (String invalid : new String[]{
|
||||
unknownAccessTier, missingDays, missingAccessTier, zeroDays, nonNumericDays}) {
|
||||
AwsException e = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Enabled</Status>" + invalid)),
|
||||
() -> "expected rejection of: " + invalid);
|
||||
assertEquals("MalformedXML", e.getErrorCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsDaysThatOverflowIntegerRange() {
|
||||
// A value above Integer.MAX_VALUE matches the \\d+ regex but overflows parseInt.
|
||||
// AWS answers MalformedXML, not InternalError.
|
||||
String overflowDays = "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier>"
|
||||
+ "<Days>99999999999999999999</Days></Tiering>";
|
||||
AwsException e = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Enabled</Status>" + overflowDays)));
|
||||
assertEquals("MalformedXML", e.getErrorCode());
|
||||
assertEquals(400, e.getHttpStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsArchiveAccessDaysBelowMinimum() {
|
||||
// ARCHIVE_ACCESS requires at least 90 days; AWS answers InvalidArgument, not MalformedXML.
|
||||
AwsException e = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Enabled</Status>" + tiering("ARCHIVE_ACCESS", 89))));
|
||||
assertEquals("InvalidArgument", e.getErrorCode());
|
||||
assertEquals(400, e.getHttpStatus());
|
||||
assertEquals("Tiering.Days", e.getExtendedData().get("ArgumentName"));
|
||||
assertEquals("89", e.getExtendedData().get("ArgumentValue"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsDeepArchiveAccessDaysBelowMinimum() {
|
||||
// DEEP_ARCHIVE_ACCESS requires at least 180 days; 90 is valid for ARCHIVE_ACCESS but not here.
|
||||
AwsException e = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Enabled</Status>" + tiering("DEEP_ARCHIVE_ACCESS", 90))));
|
||||
assertEquals("InvalidArgument", e.getErrorCode());
|
||||
assertEquals(400, e.getHttpStatus());
|
||||
assertEquals("Tiering.Days", e.getExtendedData().get("ArgumentName"));
|
||||
assertEquals("90", e.getExtendedData().get("ArgumentValue"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsDaysAboveMaximum() {
|
||||
// Both tiers are capped at 730 days.
|
||||
AwsException archive = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Enabled</Status>" + tiering("ARCHIVE_ACCESS", 731))));
|
||||
assertEquals("InvalidArgument", archive.getErrorCode());
|
||||
assertEquals(400, archive.getHttpStatus());
|
||||
assertEquals("Tiering.Days", archive.getExtendedData().get("ArgumentName"));
|
||||
assertEquals("731", archive.getExtendedData().get("ArgumentValue"));
|
||||
|
||||
AwsException deep = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Enabled</Status>" + tiering("DEEP_ARCHIVE_ACCESS", 731))));
|
||||
assertEquals("InvalidArgument", deep.getErrorCode());
|
||||
assertEquals(400, deep.getHttpStatus());
|
||||
assertEquals("Tiering.Days", deep.getExtendedData().get("ArgumentName"));
|
||||
assertEquals("731", deep.getExtendedData().get("ArgumentValue"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void acceptsDaysAtTierBoundaries() {
|
||||
// The minimum and maximum are inclusive.
|
||||
assertEquals("<Id>a</Id><Status>Enabled</Status>"
|
||||
+ "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier><Days>90</Days></Tiering>",
|
||||
S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Enabled</Status>" + tiering("ARCHIVE_ACCESS", 90))).innerXml());
|
||||
assertEquals("<Id>a</Id><Status>Enabled</Status>"
|
||||
+ "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier><Days>730</Days></Tiering>",
|
||||
S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Enabled</Status>" + tiering("ARCHIVE_ACCESS", 730))).innerXml());
|
||||
assertEquals("<Id>a</Id><Status>Enabled</Status>"
|
||||
+ "<Tiering><AccessTier>DEEP_ARCHIVE_ACCESS</AccessTier><Days>180</Days></Tiering>",
|
||||
S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Enabled</Status>" + tiering("DEEP_ARCHIVE_ACCESS", 180))).innerXml());
|
||||
assertEquals("<Id>a</Id><Status>Enabled</Status>"
|
||||
+ "<Tiering><AccessTier>DEEP_ARCHIVE_ACCESS</AccessTier><Days>730</Days></Tiering>",
|
||||
S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Enabled</Status>" + tiering("DEEP_ARCHIVE_ACCESS", 730))).innerXml());
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsOutOfRangeDaysInOneOfSeveralTierings() {
|
||||
// A valid tiering followed by an out-of-range one must still be rejected.
|
||||
AwsException e = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(body(
|
||||
"<Id>a</Id><Status>Enabled</Status>"
|
||||
+ tiering("ARCHIVE_ACCESS", 90)
|
||||
+ tiering("DEEP_ARCHIVE_ACCESS", 179))));
|
||||
assertEquals("InvalidArgument", e.getErrorCode());
|
||||
assertEquals(400, e.getHttpStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsFiltersThatAreNotExactlyOnePredicate() {
|
||||
String suffix = "<Status>Enabled</Status>" + tiering("ARCHIVE_ACCESS", 90);
|
||||
String bothPrefixAndTag = "<Id>a</Id><Filter><Prefix>logs/</Prefix>"
|
||||
+ "<Tag><Key>env</Key><Value>prod</Value></Tag></Filter>" + suffix;
|
||||
String emptyFilter = "<Id>a</Id><Filter></Filter>" + suffix;
|
||||
String andWithOnePredicate = "<Id>a</Id><Filter><And><Prefix>logs/</Prefix></And></Filter>" + suffix;
|
||||
String andWithOneTag = "<Id>a</Id><Filter><And>"
|
||||
+ "<Tag><Key>env</Key><Value>prod</Value></Tag></And></Filter>" + suffix;
|
||||
String tagWithoutAKey = "<Id>a</Id><Filter><Tag><Value>prod</Value></Tag></Filter>" + suffix;
|
||||
String tagWithoutAValue = "<Id>a</Id><Filter><Tag><Key>env</Key></Tag></Filter>" + suffix;
|
||||
String unknownPredicate = "<Id>a</Id><Filter><Something>x</Something></Filter>" + suffix;
|
||||
String andWithAnUnknownConjunct = "<Id>a</Id><Filter><And><Prefix>logs/</Prefix>"
|
||||
+ "<Something>x</Something></And></Filter>" + suffix;
|
||||
|
||||
for (String invalid : new String[]{
|
||||
bothPrefixAndTag, emptyFilter, andWithOnePredicate, andWithOneTag, tagWithoutAKey,
|
||||
tagWithoutAValue, unknownPredicate, andWithAnUnknownConjunct}) {
|
||||
AwsException e = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(body(invalid)),
|
||||
() -> "expected rejection of: " + invalid);
|
||||
assertEquals("MalformedXML", e.getErrorCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsDuplicateOrMisplacedElements() {
|
||||
String valid = "<Id>a</Id><Status>Enabled</Status>" + tiering("ARCHIVE_ACCESS", 90);
|
||||
// Normalizing these away would store a configuration that is not the one that was sent.
|
||||
String twoIds = "<Id>a</Id><Id>b</Id><Status>Enabled</Status>" + tiering("ARCHIVE_ACCESS", 90);
|
||||
String twoStatuses = "<Id>a</Id><Status>Enabled</Status><Status>Disabled</Status>"
|
||||
+ tiering("ARCHIVE_ACCESS", 90);
|
||||
String twoFilters = "<Id>a</Id><Filter><Prefix>x</Prefix></Filter>"
|
||||
+ "<Filter><Prefix>y</Prefix></Filter><Status>Enabled</Status>"
|
||||
+ tiering("ARCHIVE_ACCESS", 90);
|
||||
String strayElement = valid + "<Prefix>logs/</Prefix>";
|
||||
|
||||
for (String invalid : new String[]{twoIds, twoStatuses, twoFilters, strayElement}) {
|
||||
AwsException e = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(body(invalid)),
|
||||
() -> "expected rejection of: " + invalid);
|
||||
assertEquals("MalformedXML", e.getErrorCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void acceptsElementsInAnyOrder() {
|
||||
// Element order is not something to be strict about; the set of elements is.
|
||||
assertEquals("<Id>a</Id><Filter><Prefix>logs/</Prefix></Filter><Status>Enabled</Status>"
|
||||
+ "<Tiering><AccessTier>ARCHIVE_ACCESS</AccessTier><Days>90</Days></Tiering>",
|
||||
S3IntelligentTieringConfiguration.parse(body(tiering("ARCHIVE_ACCESS", 90)
|
||||
+ "<Status>Enabled</Status><Filter><Prefix>logs/</Prefix></Filter>"
|
||||
+ "<Id>a</Id>")).innerXml());
|
||||
}
|
||||
|
||||
@Test
|
||||
void refusesToResolveExternalEntities() {
|
||||
// The parser must not read local files on behalf of a request body.
|
||||
String xxe = "<?xml version=\"1.0\"?>"
|
||||
+ "<!DOCTYPE foo [<!ENTITY xxe SYSTEM \"file:///etc/passwd\">]>"
|
||||
+ "<IntelligentTieringConfiguration><Id>&xxe;</Id></IntelligentTieringConfiguration>";
|
||||
|
||||
AwsException e = assertThrows(AwsException.class,
|
||||
() -> S3IntelligentTieringConfiguration.parse(xxe));
|
||||
assertEquals("MalformedXML", e.getErrorCode());
|
||||
}
|
||||
}
|
||||
@@ -976,4 +976,150 @@ class S3ServiceTest {
|
||||
"configuration config-" + i + " was lost by a concurrent put");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void intelligentTieringConfigurationsOnABucketWithoutAnyBehaveAsEmpty() {
|
||||
// A bucket persisted before this field existed deserializes with a null map, which is the
|
||||
// same shape a freshly created bucket has, so neither may fault.
|
||||
s3Service.createBucket("no-tiering", "us-east-1");
|
||||
|
||||
assertTrue(s3Service.listBucketIntelligentTieringConfigurations("no-tiering")
|
||||
.contains("<IsTruncated>false</IsTruncated>"));
|
||||
assertEquals("NoSuchConfiguration", assertThrows(AwsException.class,
|
||||
() -> s3Service.getBucketIntelligentTieringConfiguration("no-tiering", "any")).getErrorCode());
|
||||
assertEquals("NoSuchConfiguration", assertThrows(AwsException.class,
|
||||
() -> s3Service.deleteBucketIntelligentTieringConfiguration("no-tiering", "any")).getErrorCode());
|
||||
|
||||
// And the first put still lands on it.
|
||||
s3Service.putBucketIntelligentTieringConfiguration("no-tiering", "first", "<Id>first</Id>");
|
||||
assertTrue(s3Service.getBucketIntelligentTieringConfiguration("no-tiering", "first")
|
||||
.contains("<Id>first</Id>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void intelligentTieringPutReplacesTheConfigurationStoredUnderTheSameId() {
|
||||
s3Service.createBucket("tiering-replace", "us-east-1");
|
||||
s3Service.putBucketIntelligentTieringConfiguration("tiering-replace", "id",
|
||||
"<Id>id</Id><Status>Enabled</Status>");
|
||||
s3Service.putBucketIntelligentTieringConfiguration("tiering-replace", "id",
|
||||
"<Id>id</Id><Status>Disabled</Status>");
|
||||
|
||||
String stored = s3Service.getBucketIntelligentTieringConfiguration("tiering-replace", "id");
|
||||
assertTrue(stored.contains("<Status>Disabled</Status>"));
|
||||
assertTrue(s3Service.listBucketIntelligentTieringConfigurations("tiering-replace")
|
||||
.indexOf("<Id>id</Id>") == s3Service
|
||||
.listBucketIntelligentTieringConfigurations("tiering-replace")
|
||||
.lastIndexOf("<Id>id</Id>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void intelligentTieringConfigurationsAreIsolatedPerBucket() {
|
||||
s3Service.createBucket("tiering-a", "us-east-1");
|
||||
s3Service.createBucket("tiering-b", "us-east-1");
|
||||
s3Service.putBucketIntelligentTieringConfiguration("tiering-a", "shared",
|
||||
"<Id>shared</Id><Status>Enabled</Status>");
|
||||
s3Service.putBucketIntelligentTieringConfiguration("tiering-b", "shared",
|
||||
"<Id>shared</Id><Status>Disabled</Status>");
|
||||
|
||||
assertTrue(s3Service.getBucketIntelligentTieringConfiguration("tiering-a", "shared")
|
||||
.contains("<Status>Enabled</Status>"));
|
||||
assertTrue(s3Service.getBucketIntelligentTieringConfiguration("tiering-b", "shared")
|
||||
.contains("<Status>Disabled</Status>"));
|
||||
|
||||
s3Service.deleteBucketIntelligentTieringConfiguration("tiering-a", "shared");
|
||||
|
||||
assertEquals("NoSuchConfiguration", assertThrows(AwsException.class,
|
||||
() -> s3Service.getBucketIntelligentTieringConfiguration("tiering-a", "shared")).getErrorCode());
|
||||
assertTrue(s3Service.getBucketIntelligentTieringConfiguration("tiering-b", "shared")
|
||||
.contains("<Status>Disabled</Status>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void intelligentTieringConfigurationsDoNotOutliveTheirBucket() {
|
||||
s3Service.createBucket("recycled-tiering", "us-east-1");
|
||||
s3Service.putBucketIntelligentTieringConfiguration("recycled-tiering", "old", "<Id>old</Id>");
|
||||
s3Service.deleteBucket("recycled-tiering");
|
||||
|
||||
s3Service.createBucket("recycled-tiering", "us-east-1");
|
||||
|
||||
assertEquals("NoSuchConfiguration", assertThrows(AwsException.class,
|
||||
() -> s3Service.getBucketIntelligentTieringConfiguration("recycled-tiering", "old")).getErrorCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
void intelligentTieringConfigurationsSurviveARestart() {
|
||||
// Through the real storage layer rather than Jackson alone: written, flushed to disk, and
|
||||
// read back by a second service over the same file, the way a restart does it.
|
||||
Path bucketsFile = tempDir.resolve("s3-buckets-tiering.json");
|
||||
var beforeRestart = new io.github.hectorvent.floci.core.storage.HybridStorage<String, Bucket>(
|
||||
bucketsFile, new com.fasterxml.jackson.core.type.TypeReference<Map<String, Bucket>>() {}, 60000);
|
||||
S3Service before = new S3Service(beforeRestart, new InMemoryStorage<>(), tempDir.resolve("s3b"), false);
|
||||
before.createBucket("persisted-tiering", "us-east-1");
|
||||
before.putBucketIntelligentTieringConfiguration("persisted-tiering", "EntireBucket",
|
||||
"<Id>EntireBucket</Id>");
|
||||
beforeRestart.flush();
|
||||
beforeRestart.shutdown();
|
||||
|
||||
var afterRestart = new io.github.hectorvent.floci.core.storage.HybridStorage<String, Bucket>(
|
||||
bucketsFile, new com.fasterxml.jackson.core.type.TypeReference<Map<String, Bucket>>() {}, 60000);
|
||||
afterRestart.load();
|
||||
try {
|
||||
S3Service after = new S3Service(afterRestart, new InMemoryStorage<>(), tempDir.resolve("s3b"), false);
|
||||
assertTrue(after.getBucketIntelligentTieringConfiguration("persisted-tiering", "EntireBucket")
|
||||
.contains("<Id>EntireBucket</Id>"));
|
||||
} finally {
|
||||
afterRestart.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void intelligentTieringConfigurationsSurviveAJacksonRoundTrip() throws Exception {
|
||||
// Bucket records are persisted as JSON, so the configurations have to come back after a
|
||||
// restart, and a record written before the field existed has to still load.
|
||||
var mapper = new com.fasterxml.jackson.databind.ObjectMapper().findAndRegisterModules();
|
||||
Bucket bucket = new Bucket("persisted");
|
||||
bucket.setIntelligentTieringConfigurations(new java.util.LinkedHashMap<>(
|
||||
Map.of("EntireBucket", "<Id>EntireBucket</Id>")));
|
||||
|
||||
Bucket reloaded = mapper.readValue(mapper.writeValueAsString(bucket), Bucket.class);
|
||||
assertEquals("<Id>EntireBucket</Id>",
|
||||
reloaded.getIntelligentTieringConfigurations().get("EntireBucket"));
|
||||
|
||||
Bucket legacy = mapper.readValue("{\"name\":\"legacy\"}", Bucket.class);
|
||||
assertNull(legacy.getIntelligentTieringConfigurations());
|
||||
}
|
||||
|
||||
@Test
|
||||
void concurrentIntelligentTieringConfigurationPutsAllSurvive() throws Exception {
|
||||
// Each put reads the configuration map, adds to it and writes it back, so without a shared
|
||||
// monitor concurrent puts of different ids overwrite each other's work.
|
||||
s3Service.createBucket("tiering-race", "us-east-1");
|
||||
int count = 24;
|
||||
var pool = java.util.concurrent.Executors.newFixedThreadPool(8);
|
||||
var start = new java.util.concurrent.CountDownLatch(1);
|
||||
try {
|
||||
var submitted = new java.util.ArrayList<java.util.concurrent.Future<?>>();
|
||||
for (int i = 0; i < count; i++) {
|
||||
String id = "config-" + i;
|
||||
submitted.add(pool.submit(() -> {
|
||||
start.await();
|
||||
s3Service.putBucketIntelligentTieringConfiguration("tiering-race", id,
|
||||
"<Id>" + id + "</Id>");
|
||||
return null;
|
||||
}));
|
||||
}
|
||||
start.countDown();
|
||||
for (var future : submitted) {
|
||||
future.get(30, java.util.concurrent.TimeUnit.SECONDS);
|
||||
}
|
||||
} finally {
|
||||
pool.shutdownNow();
|
||||
}
|
||||
|
||||
String listed = s3Service.listBucketIntelligentTieringConfigurations("tiering-race");
|
||||
for (int i = 0; i < count; i++) {
|
||||
assertTrue(listed.contains("<Id>config-" + i + "</Id>"),
|
||||
"configuration config-" + i + " was lost by a concurrent put");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user