def METHOD_NAME(
    mocker, payloadNumberOfProcessors, ceNumberOfProcessors, expectedResult, expectedNumberOfProcessors
):
    """Test RemoteRunner()._setUpWorkloadCE()"""
    mocker.patch(
        "DIRAC.WorkloadManagementSystem.Utilities.RemoteRunner.getProxyInfo", return_value=S_OK({"chain": X509Chain()})
    )
    mocker.patch("DIRAC.Core.Security.X509Chain.X509Chain.getRemainingSecs", return_value=S_OK(1000))
    # Configure the CS with the number of available processors in the CE
    siteName = "DIRAC.Site1.site"
    ceName = "CE1"
    queueName = "queue1"
    config = {"Resources": {"Sites": {"DIRAC": {siteName: {"CEs": {ceName: {}}}}}}}
    ceConfig = config["Resources"]["Sites"]["DIRAC"][siteName]["CEs"][ceName]
    ceConfig["CEType"] = "HTCondorCE"
    ceConfig["Queues"] = {}
    ceConfig["Queues"][queueName] = {}
    ceConfig["Queues"][queueName]["NumberOfProcessors"] = ceNumberOfProcessors
    # Load the configuration
    gConfigurationData.localCFG = CFG()
    cfg = CFG()
    cfg.loadFromDict(config)
    gConfig.loadCFG(cfg)
    # Instantiate a RemoteRunner and set up the CE
    remoteRunner = RemoteRunner(siteName, ceName, queueName)
    result = remoteRunner._setUpWorkloadCE(payloadNumberOfProcessors)
    # Test the results
    assert result["OK"] == expectedResult
    if expectedResult:
        workloadCE = result["Value"]
        assert workloadCE.ceParameters["NumberOfProcessors"] == expectedNumberOfProcessors
    else:
        assert result["Message"] == expectedNumberOfProcessors