use of com.runwaysdk.system.scheduler.ExecutionContext in project geoprism-registry by terraframe.
the class BusinessObjectImporterTest method mockImport.
private ImportHistory mockImport(BusinessObjectImportConfiguration config) throws Throwable {
if (config.getDate() == null) {
config.setDate(new Date());
}
config.setImportStrategy(ImportStrategy.NEW_AND_UPDATE);
DataImportJob job = new DataImportJob();
job.apply();
ImportHistory hist = (ImportHistory) job.createNewHistory();
config.setHistoryId(hist.getOid());
config.setJobId(job.getOid());
BusinessType type = config.getType();
hist.appLock();
hist.setImportFileId(config.getVaultFileId());
hist.setConfigJson(config.toJSON().toString());
hist.setOrganization(type.getOrganization());
hist.setGeoObjectTypeCode(type.getCode());
hist.apply();
ExecutionContext context = MockScheduler.executeJob(job, hist);
hist = (ImportHistory) context.getHistory();
return hist;
}
Aggregations