{
  "runOn": [
    {
      "minServerVersion": "6.0.0",
      "topology": [
        "replicaset",
        "sharded",
        "load-balanced"
      ]
    }
  ],
  "database_name": "default",
  "collection_name": "default",
  "tests": [
    {
      "description": "state collections and index are created",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "aws": {}
          },
          "encryptedFieldsMap": {
            "default.encryptedCollection": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "operations": [
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "createCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.esc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecoc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertIndexExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection",
            "index": "__safeContent___1"
          }
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.esc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecoc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection",
              "encryptedFields": {
                "escCollection": "encryptedCollection.esc",
                "eccCollection": "encryptedCollection.ecc",
                "ecocCollection": "encryptedCollection.ecoc",
                "fields": [
                  {
                    "path": "firstName",
                    "bsonType": "string",
                    "keyId": {
                      "$binary": {
                        "subType": "04",
                        "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                      }
                    }
                  }
                ]
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "createIndexes": "encryptedCollection",
              "indexes": [
                {
                  "name": "__safeContent___1",
                  "key": {
                    "__safeContent__": 1
                  }
                }
              ]
            },
            "command_name": "createIndexes",
            "database_name": "default"
          }
        }
      ]
    },
    {
      "description": "default state collection names are applied",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "aws": {}
          },
          "encryptedFieldsMap": {
            "default.encryptedCollection": {
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  },
                  "queries": {
                    "queryType": "equality",
                    "contention": {
                      "$numberLong": "0"
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "operations": [
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "createCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "enxcol_.encryptedCollection.esc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "enxcol_.encryptedCollection.ecc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "enxcol_.encryptedCollection.ecoc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertIndexExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection",
            "index": "__safeContent___1"
          }
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "drop": "enxcol_.encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "enxcol_.encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "enxcol_.encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "enxcol_.encryptedCollection.esc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "enxcol_.encryptedCollection.ecc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "enxcol_.encryptedCollection.ecoc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection",
              "encryptedFields": {
                "fields": [
                  {
                    "path": "firstName",
                    "bsonType": "string",
                    "keyId": {
                      "$binary": {
                        "subType": "04",
                        "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                      }
                    },
                    "queries": {
                      "queryType": "equality",
                      "contention": {
                        "$numberLong": "0"
                      }
                    }
                  }
                ]
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "createIndexes": "encryptedCollection",
              "indexes": [
                {
                  "name": "__safeContent___1",
                  "key": {
                    "__safeContent__": 1
                  }
                }
              ]
            },
            "command_name": "createIndexes",
            "database_name": "default"
          }
        }
      ]
    },
    {
      "description": "drop removes all state collections",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "aws": {}
          },
          "encryptedFieldsMap": {
            "default.encryptedCollection": {
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  },
                  "queries": {
                    "queryType": "equality",
                    "contention": {
                      "$numberLong": "0"
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "operations": [
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "createCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "enxcol_.encryptedCollection.esc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "enxcol_.encryptedCollection.ecc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "enxcol_.encryptedCollection.ecoc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertIndexExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection",
            "index": "__safeContent___1"
          }
        },
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertCollectionNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "enxcol_.encryptedCollection.ecc"
          }
        },
        {
          "name": "assertCollectionNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "enxcol_.encryptedCollection.ecoc"
          }
        },
        {
          "name": "assertCollectionNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertIndexNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection",
            "index": "__safeContent___1"
          }
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "drop": "enxcol_.encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "enxcol_.encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "enxcol_.encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "enxcol_.encryptedCollection.esc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "enxcol_.encryptedCollection.ecc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "enxcol_.encryptedCollection.ecoc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection",
              "encryptedFields": {
                "fields": [
                  {
                    "path": "firstName",
                    "bsonType": "string",
                    "keyId": {
                      "$binary": {
                        "subType": "04",
                        "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                      }
                    },
                    "queries": {
                      "queryType": "equality",
                      "contention": {
                        "$numberLong": "0"
                      }
                    }
                  }
                ]
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "createIndexes": "encryptedCollection",
              "indexes": [
                {
                  "name": "__safeContent___1",
                  "key": {
                    "__safeContent__": 1
                  }
                }
              ]
            },
            "command_name": "createIndexes",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "enxcol_.encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "enxcol_.encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "enxcol_.encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        }
      ]
    },
    {
      "description": "encryptedFieldsMap with cyclic entries does not loop",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "aws": {}
          },
          "encryptedFieldsMap": {
            "default.encryptedCollection": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            },
            "default.encryptedCollection.esc": {
              "escCollection": "encryptedCollection",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "operations": [
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "createCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.esc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecoc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertIndexExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection",
            "index": "__safeContent___1"
          }
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.esc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecoc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection",
              "encryptedFields": {
                "escCollection": "encryptedCollection.esc",
                "eccCollection": "encryptedCollection.ecc",
                "ecocCollection": "encryptedCollection.ecoc",
                "fields": [
                  {
                    "path": "firstName",
                    "bsonType": "string",
                    "keyId": {
                      "$binary": {
                        "subType": "04",
                        "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                      }
                    }
                  }
                ]
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "createIndexes": "encryptedCollection",
              "indexes": [
                {
                  "name": "__safeContent___1",
                  "key": {
                    "__safeContent__": 1
                  }
                }
              ]
            },
            "command_name": "createIndexes",
            "database_name": "default"
          }
        }
      ]
    },
    {
      "description": "CreateCollection without encryptedFields.",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "aws": {}
          },
          "encryptedFieldsMap": {
            "default.encryptedCollection": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "operations": [
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "plaintextCollection"
          }
        },
        {
          "name": "createCollection",
          "object": "database",
          "arguments": {
            "collection": "plaintextCollection"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "plaintextCollection"
          }
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "listCollections": 1,
              "filter": {
                "name": "plaintextCollection"
              }
            },
            "command_name": "listCollections",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "plaintextCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "plaintextCollection"
            },
            "command_name": "create",
            "database_name": "default"
          }
        }
      ]
    },
    {
      "description": "CreateCollection from encryptedFieldsMap.",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "aws": {}
          },
          "encryptedFieldsMap": {
            "default.encryptedCollection": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "operations": [
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "createCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.esc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecoc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertIndexExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection",
            "index": "__safeContent___1"
          }
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.esc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecoc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection",
              "encryptedFields": {
                "escCollection": "encryptedCollection.esc",
                "eccCollection": "encryptedCollection.ecc",
                "ecocCollection": "encryptedCollection.ecoc",
                "fields": [
                  {
                    "path": "firstName",
                    "bsonType": "string",
                    "keyId": {
                      "$binary": {
                        "subType": "04",
                        "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                      }
                    }
                  }
                ]
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "createIndexes": "encryptedCollection",
              "indexes": [
                {
                  "name": "__safeContent___1",
                  "key": {
                    "__safeContent__": 1
                  }
                }
              ]
            },
            "command_name": "createIndexes",
            "database_name": "default"
          }
        }
      ]
    },
    {
      "description": "CreateCollection from encryptedFields.",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "aws": {}
          }
        }
      },
      "operations": [
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection",
            "encryptedFields": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "name": "createCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection",
            "encryptedFields": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.esc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecoc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertIndexExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection",
            "index": "__safeContent___1"
          }
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.esc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecoc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection",
              "encryptedFields": {
                "escCollection": "encryptedCollection.esc",
                "eccCollection": "encryptedCollection.ecc",
                "ecocCollection": "encryptedCollection.ecoc",
                "fields": [
                  {
                    "path": "firstName",
                    "bsonType": "string",
                    "keyId": {
                      "$binary": {
                        "subType": "04",
                        "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                      }
                    }
                  }
                ]
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "listCollections": 1,
              "filter": {
                "name": "encryptedCollection"
              }
            },
            "command_name": "listCollections",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "createIndexes": "encryptedCollection",
              "indexes": [
                {
                  "name": "__safeContent___1",
                  "key": {
                    "__safeContent__": 1
                  }
                }
              ]
            },
            "command_name": "createIndexes",
            "database_name": "default"
          }
        }
      ]
    },
    {
      "description": "DropCollection from encryptedFieldsMap",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "aws": {}
          },
          "encryptedFieldsMap": {
            "default.encryptedCollection": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "operations": [
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        }
      ]
    },
    {
      "description": "DropCollection from encryptedFields",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "aws": {}
          },
          "encryptedFieldsMap": {}
        }
      },
      "operations": [
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection",
            "encryptedFields": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "name": "createCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection",
            "encryptedFields": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.esc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecoc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertIndexExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection",
            "index": "__safeContent___1"
          }
        },
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection",
            "encryptedFields": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "name": "assertCollectionNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.esc"
          }
        },
        {
          "name": "assertCollectionNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecc"
          }
        },
        {
          "name": "assertCollectionNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecoc"
          }
        },
        {
          "name": "assertCollectionNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection"
          }
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.esc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecoc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection",
              "encryptedFields": {
                "escCollection": "encryptedCollection.esc",
                "eccCollection": "encryptedCollection.ecc",
                "ecocCollection": "encryptedCollection.ecoc",
                "fields": [
                  {
                    "path": "firstName",
                    "bsonType": "string",
                    "keyId": {
                      "$binary": {
                        "subType": "04",
                        "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                      }
                    }
                  }
                ]
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "listCollections": 1,
              "filter": {
                "name": "encryptedCollection"
              }
            },
            "command_name": "listCollections",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "createIndexes": "encryptedCollection",
              "indexes": [
                {
                  "name": "__safeContent___1",
                  "key": {
                    "__safeContent__": 1
                  }
                }
              ]
            },
            "command_name": "createIndexes",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        }
      ]
    },
    {
      "description": "DropCollection from remote encryptedFields",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "aws": {}
          },
          "encryptedFieldsMap": {}
        }
      },
      "operations": [
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection",
            "encryptedFields": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "name": "createCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection",
            "encryptedFields": {
              "escCollection": "encryptedCollection.esc",
              "eccCollection": "encryptedCollection.ecc",
              "ecocCollection": "encryptedCollection.ecoc",
              "fields": [
                {
                  "path": "firstName",
                  "bsonType": "string",
                  "keyId": {
                    "$binary": {
                      "subType": "04",
                      "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.esc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecoc"
          }
        },
        {
          "name": "assertCollectionExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertIndexExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection",
            "index": "__safeContent___1"
          }
        },
        {
          "name": "dropCollection",
          "object": "database",
          "arguments": {
            "collection": "encryptedCollection"
          }
        },
        {
          "name": "assertCollectionNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.esc"
          }
        },
        {
          "name": "assertCollectionNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecc"
          }
        },
        {
          "name": "assertCollectionNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection.ecoc"
          }
        },
        {
          "name": "assertCollectionNotExists",
          "object": "testRunner",
          "arguments": {
            "database": "default",
            "collection": "encryptedCollection"
          }
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.esc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection.ecoc",
              "clusteredIndex": {
                "key": {
                  "_id": 1
                },
                "unique": true
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "create": "encryptedCollection",
              "encryptedFields": {
                "escCollection": "encryptedCollection.esc",
                "eccCollection": "encryptedCollection.ecc",
                "ecocCollection": "encryptedCollection.ecoc",
                "fields": [
                  {
                    "path": "firstName",
                    "bsonType": "string",
                    "keyId": {
                      "$binary": {
                        "subType": "04",
                        "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
                      }
                    }
                  }
                ]
              }
            },
            "command_name": "create",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "listCollections": 1,
              "filter": {
                "name": "encryptedCollection"
              }
            },
            "command_name": "listCollections",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "createIndexes": "encryptedCollection",
              "indexes": [
                {
                  "name": "__safeContent___1",
                  "key": {
                    "__safeContent__": 1
                  }
                }
              ]
            },
            "command_name": "createIndexes",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "listCollections": 1,
              "filter": {
                "name": "encryptedCollection"
              }
            },
            "command_name": "listCollections",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.esc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection.ecoc"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        },
        {
          "command_started_event": {
            "command": {
              "drop": "encryptedCollection"
            },
            "command_name": "drop",
            "database_name": "default"
          }
        }
      ]
    }
  ]
}
