JobDataMap map = new JobDataMap();
map.put(PinsetterJobListener.PRINCIPAL_KEY, mock(Principal.class));
map.put(JobStatus.TARGET_TYPE, JobStatus.TargetType.OWNER);
map.put(JobStatus.TARGET_ID, "admin");
JobDetailImpl detail = mock(JobDetailImpl.class);
JobKey jobKey = jobKey("name", "group");
when(detail.getKey()).thenReturn(jobKey);
when(detail.getJobDataMap()).thenReturn(map);
Mockito.doReturn(TestJob.class).when(detail).getJobClass();
pk = new PinsetterKernel(config, jfactory, jlistener, jcurator, sfactory);
pk.scheduleSingleJob(detail);