org.jobrunr.server.runner.MockJobContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jobrunr Show documentation
Show all versions of jobrunr Show documentation
An easy way to perform background processing on the JVM. Backed by persistent storage. Open and free for commercial use.
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