mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(iot): return ConflictException for shadow version mismatch (#5814)
* fix(iot): return ConflictException for shadow version mismatch * fix(iot): match AWS shadow version conflict message * test(iot): expect modeled shadow conflict in Python SDK
This commit is contained in:
1 parent
e245dbbdd5
commit
eb84539a67
3 files changed
+40
-3
No files matched your search
@@ -193,7 +193,9 @@ class IotDataIntegrationTest {
|
||||
.post("/things/mvp1-shadow/shadow")
|
||||
.then()
|
||||
.statusCode(409)
|
||||
.body("__type", equalTo("VersionConflictException"));
|
||||
.header("x-amzn-ErrorType", equalTo("ConflictException"))
|
||||
.body("__type", equalTo("ConflictException"))
|
||||
.body("message", equalTo("Version conflict"));
|
||||
|
||||
given()
|
||||
.contentType("application/json")
|
||||
@@ -205,4 +207,38 @@ class IotDataIntegrationTest {
|
||||
.body("state.desired", nullValue())
|
||||
.body("version", equalTo(3));
|
||||
}
|
||||
|
||||
@Test
|
||||
void namedShadowVersionConflictUsesIotDataErrorCode() {
|
||||
given()
|
||||
.contentType("application/json")
|
||||
.queryParam("name", "settings")
|
||||
.body("{\"state\":{\"desired\":{\"mode\":\"auto\"}}}")
|
||||
.when()
|
||||
.post("/things/mvp1-versioned-named/shadow")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("version", equalTo(1));
|
||||
|
||||
given()
|
||||
.contentType("application/json")
|
||||
.queryParam("name", "settings")
|
||||
.body("{\"version\":0,\"state\":{\"desired\":{\"mode\":\"manual\"}}}")
|
||||
.when()
|
||||
.post("/things/mvp1-versioned-named/shadow")
|
||||
.then()
|
||||
.statusCode(409)
|
||||
.header("x-amzn-ErrorType", equalTo("ConflictException"))
|
||||
.body("__type", equalTo("ConflictException"))
|
||||
.body("message", equalTo("Version conflict"));
|
||||
|
||||
given()
|
||||
.queryParam("name", "settings")
|
||||
.when()
|
||||
.get("/things/mvp1-versioned-named/shadow")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("version", equalTo(1))
|
||||
.body("state.desired.mode", equalTo("auto"));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user