def METHOD_NAME(self):
    credential = AzureKeyCredential(key="old_api_key")
    client = SearchIndexerClient("endpoint", credential)
    assert client._headers == {
        "api-key": "old_api_key",
        "Accept": "application/json;odata.metadata=minimal",
    }
    credential.update("new_api_key")
    assert client._headers == {
        "api-key": "new_api_key",
        "Accept": "application/json;odata.metadata=minimal",
    }