use of io.elastest.etm.model.external.ExternalTestCase in project elastest-torm by elastest.
the class TestLinkService method syncProjectTestCase.
public void syncProjectTestCase(TestCase testCase, ExternalTJob externalTJob) {
ExternalTestCase externalTestCase = new ExternalTestCase(new Long(0));
externalTestCase.setExTJob(externalTJob);
externalTestCase.setName(testCase.getName());
externalTestCase.setFields(this.getTestCaseFields(testCase));
externalTestCase.setExternalId(testCase.getId().toString());
externalTestCase.setExternalSystemId(this.getSystemId());
try {
externalTestCase = externalTestCaseRepository.save(externalTestCase);
} catch (DataIntegrityViolationException existException) {
ExternalTestCase savedTestCase = externalTestCaseRepository.findByExternalIdAndExternalSystemId(externalTestCase.getExternalId(), externalTestCase.getExternalSystemId());
externalTestCase.setId(savedTestCase.getId());
externalTestCase = externalTestCaseRepository.save(externalTestCase);
}
this.syncTestCaseExecs(testCase.getId(), externalTestCase);
}
use of io.elastest.etm.model.external.ExternalTestCase in project elastest-torm by elastest.
the class TestLinkService method cleanExternalTJobFromExternalTestCases.
public void cleanExternalTJobFromExternalTestCases(ExternalTJob externalTJob) {
List<ExternalTestCase> externalTestCases = externalTestCaseRepository.findByExTJob(externalTJob);
if (externalTestCases != null) {
for (ExternalTestCase currentCase : externalTestCases) {
currentCase.setExTJob(null);
externalTestCaseRepository.save(currentCase);
}
}
}
Aggregations