use of io.elastest.etm.model.external.ExternalTJobExecution in project elastest-torm by elastest.
the class ExternalService method setExternalTJobExecToTestExecutionByExecutionId.
public ExternalTestExecution setExternalTJobExecToTestExecutionByExecutionId(Integer execId, Long exTJobExecId) {
ExternalTJobExecution exTJobExec = this.externalTJobExecutionRepository.findById(exTJobExecId);
ExternalTestExecution exTestExec = this.externalTestExecutionRepository.findByExternalIdAndExternalSystemId(execId.toString(), exTJobExec.getExTJob().getExternalSystemId());
exTestExec.setExTJobExec(exTJobExec);
return this.externalTestExecutionRepository.save(exTestExec);
}
use of io.elastest.etm.model.external.ExternalTJobExecution in project elastest-torm by elastest.
the class ExternalService method createExternalTJobExecutionByExternalTJobId.
public ExternalTJobExecution createExternalTJobExecutionByExternalTJobId(Long exTJobId) {
ExternalTJob exTJob = this.externalTJobRepository.findById(exTJobId);
ExternalTJobExecution exec = new ExternalTJobExecution();
exec.setExTJob(exTJob);
exec.setStartDate(new Date());
this.externalTJobExecutionRepository.save(exec);
exec.generateMonitoringIndex();
exec = this.externalTJobExecutionRepository.save(exec);
SupportService eus = this.startEus();
if (eus != null) {
String instanceId = utilTools.generateUniqueId();
esmService.provisionExternalTJobExecServiceInstanceAsync(eus.getId(), exec, instanceId);
exec.getEnvVars().put("EUS_ID", eus.getId());
exec.getEnvVars().put("EUS_INSTANCE_ID", instanceId);
exec = this.externalTJobExecutionRepository.save(exec);
}
elasticsearchService.createMonitoringIndex(exec.getMonitoringIndicesList());
return exec;
}
Aggregations