All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jobrunr.server.runner.MockJobContext Maven / Gradle / Ivy

Go to download

An easy way to perform background processing on the JVM. Backed by persistent storage. Open and free for commercial use.

There is a newer version: 7.3.1
Show newest version
package org.jobrunr.server.runner;

import org.jobrunr.jobs.Job;
import org.jobrunr.jobs.context.JobContext;

/**
 * Class that can be used in tests to set the {@link JobContext} for a {@link org.jobrunr.jobs.lambdas.JobRequestHandler}.
 */
public class MockJobContext {

    private MockJobContext() {}

    public static void setUpJobContextForJob(Job job) {
        MockJobContext.setUpJobContext(new RunnerJobContext(job));
    }

    public static void setUpJobContext(JobContext jobContext) {
        ThreadLocalJobContext.setJobContext(jobContext);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy