@Test
public void testCreateBucket() throws B2Exception {

    final B2CreateBucketRequest request = B2CreateBucketRequest
            .builder(bucketName(1), B2BucketTypes.ALL_PUBLIC)
            .setCorsRules(Collections.singletonList(B2TestHelpers.makeCorsRule()))
            .build();
    final B2CreateBucketRequestReal requestReal = new B2CreateBucketRequestReal(ACCOUNT_ID, request);
    webifier.createBucket(ACCOUNT_AUTH, requestReal);
    webApiClient.check("postJsonReturnJson.\n" +
            "url:\n" +
            "    apiUrl1/b2api/v2/b2_create_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\": \"1\",\n" +
            "      \"bucketInfo\": null,\n" +
            "      \"bucketName\": \"bucketName1\",\n" +
            "      \"bucketType\": \"allPublic\",\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" +
            "      \"lifecycleRules\": null\n" +
            "    }\n" +
            "responseClass:\n" +
            "    B2Bucket\n"
    );
    checkRequestCategory(OTHER, w -> w.createBucket(ACCOUNT_AUTH, requestReal));
}