def METHOD_NAME(self, m_run_command, m_exit_json):
    ca_test_common.set_module_args({
        'name': fake_name,
        'image': fake_image
    })
    m_exit_json.side_effect = ca_test_common.exit_json
    stdout = ''
    stderr = ''
    rc = 0
    m_run_command.side_effect = [
        (0, '[{{"style":"legacy","name":"{}"}}]'.format(fake_name), ''),
        (rc, stdout, stderr)
    ]
    with pytest.raises(ca_test_common.AnsibleExitJson) as result:
        cephadm_adopt.main()
    result = result.value.args[0]
    assert result['changed']
    assert result['cmd'] == ['cephadm', '--image', fake_image, 'adopt', '--cluster', fake_cluster, '--name', fake_name, '--style', 'legacy']
    assert result['rc'] == 0