@Test
public void unpermittedJob() {
final Job job = new Job("TestAction", new Object[] { 1, 2.3, true, "test", Arrays.asList("inner", 4.5) });
final AtomicBoolean didFailWithUnpermittedJob = new AtomicBoolean(false);
doWork(Arrays.asList(job), map(entry("FailAction", FailAction.class)), new WorkerListener() {
public void onEvent(final WorkerEvent event, final Worker worker, final String queue, final Job job,
final Object runner, final Object result, final Throwable t) {
if (JOB_FAILURE.equals(event) && (t instanceof UnpermittedJobException)) {
didFailWithUnpermittedJob.set(true);
}