def METHOD_NAME(opts_sspi):
    opts = opts_sspi.copy()
    del opts["proxy"]["domain"]
    with patch("salt.proxy.esxdatacenter.merge", MagicMock(return_value=opts["proxy"])):
        with pytest.raises(salt.exceptions.InvalidConfigError) as excinfo:
            esxdatacenter.init(opts)
    assert (
        excinfo.value.message
        == "Mechanism is set to 'sspi', but no 'domain' key found in proxy config."
    )