fix(official-bots): NCS-70-auto-register official bots with account service (#59)
Build & Test (NowChessSystems) TeamCity build finished

Co-authored-by: Janis <janis-e@gmx.de>
Reviewed-on: #59
This commit was merged in pull request #59.
This commit is contained in:
2026-06-03 13:27:03 +02:00
parent 085e34f062
commit 7117a93376
9 changed files with 105 additions and 1 deletions
@@ -154,3 +154,35 @@ class AccountResourceTest:
.post("/api/account/refresh")
.`then`()
.statusCode(401)
@Test
def syncOfficialBotsCreatesNewBots(): Unit =
givenRequest()
.body("""{"bots":["sync-easy","sync-hard"]}""")
.when()
.post("/api/account/official-bots/sync")
.`then`()
.statusCode(204)
RestAssured
.`given`()
.when()
.get("/api/account/official-bots")
.`then`()
.statusCode(200)
.body("name", hasItems("sync-easy", "sync-hard"))
@Test
def syncOfficialBotsIsIdempotent(): Unit =
val body = """{"bots":["idempotent-bot"]}"""
givenRequest()
.body(body)
.when()
.post("/api/account/official-bots/sync")
.`then`()
.statusCode(204)
givenRequest()
.body(body)
.when()
.post("/api/account/official-bots/sync")
.`then`()
.statusCode(204)