def METHOD_NAME(self, mock_repo, mock_cluster_repo, mock_k8s_cluster_repo, reconfigure, namespace):
    config_container = mock.create_autospec(config_parse.ConfigContainer)
    master_config = config_container.get_master.return_value
    autospec_method(self.mcp.jobs.update_from_config)
    autospec_method(self.mcp.build_job_scheduler_factory)
    self.mcp.apply_config(config_container, reconfigure, namespace)
    self.mcp.state_watcher.update_from_config.assert_called_with(master_config.state_persistence,)
    assert_equal(self.mcp.context.base, master_config.command_context)
    mock_repo.update_from_config.assert_called_with(
        master_config.nodes, master_config.node_pools, master_config.ssh_options,
    )
    mock_cluster_repo.configure.assert_called_with(master_config.mesos_options,)
    mock_k8s_cluster_repo.configure.assert_called_with(master_config.k8s_options,)
    self.mcp.build_job_scheduler_factory(master_config, mock.Mock())
    expected_namespace_to_update = None if namespace == "MASTER" else namespace
    self.mcp.jobs.update_from_config.assert_called_once_with(
        config_container.get_jobs(),
        self.mcp.build_job_scheduler_factory.return_value,
        reconfigure,
        expected_namespace_to_update,
    )
    self.mcp.state_watcher.watch_all.assert_called_once_with(
        self.mcp.jobs.update_from_config.return_value, mock.ANY,
    )