@Test
public void testUpdateBucket() throws B2Exception {

    final B2UpdateBucketRequest request = B2UpdateBucketRequest
            .builder(makeBucket(1))
            .setCorsRules(Collections.singletonList(B2TestHelpers.makeCorsRule()))
            .build();
    webifier.updateBucket(ACCOUNT_AUTH, request);
    webApiClient.check("postJsonReturnJson.\n" +
            "url:\n" +
            "    apiUrl1/b2api/v2/b2_update_bucket\n" +
            "headers:\n" +
            "    Authorization: accountToken1\n" +
            "    User-Agent: SecretAgentMan/3.19.28\n" +
            "    X-Bz-Test-Mode: force_cap_exceeded\n" +
            "request:\n" +
            "    {\n" +
            "      \"accountId\": \"accountId1\",\n" +
            "      \"bucketId\": \"bucket1\",\n" +
            "      \"bucketInfo\": null,\n" +
            "      \"bucketType\": null,\n" +
            "      \"corsRules\": [\n" +
            "        {\n" +
            "          \"allowedHeaders\": null,\n" +
            "          \"allowedOperations\": [\n" +
            "            \"b2_download_file_by_id\"\n" +
            "          ],\n" +
            "          \"allowedOrigins\": [\n" +
            "            \"https://something.com\"\n" +
            "          ],\n" +
            "          \"corsRuleName\": \"rule-name\",\n" +
            "          \"exposeHeaders\": null,\n" +
            "          \"maxAgeSeconds\": 0\n" +
            "        }\n" +
            "      ],\n" +
            "      \"ifRevisionIs\": 1,\n" +
            "      \"lifecycleRules\": null\n" +
            "    }\n" +
            "responseClass:\n" +
            "    B2Bucket\n"
    );
    checkRequestCategory(OTHER, w -> w.updateBucket(ACCOUNT_AUTH, request));
}