Search in sources :

Example 1 with ExternalProject

use of io.elastest.etm.model.external.ExternalProject in project elastest-torm by elastest.

the class TestLinkService method syncProject.

public void syncProject(TestProject project) {
    ExternalProject externalProject = new ExternalProject(new Long(0));
    externalProject.setName(project.getName());
    externalProject.setType(TypeEnum.TESTLINK);
    externalProject.setExternalId(project.getId().toString());
    externalProject.setExternalSystemId(this.getSystemId());
    try {
        externalProject = externalProjectRepository.save(externalProject);
    } catch (DataIntegrityViolationException existException) {
        ExternalProject savedPj = externalProjectRepository.findByExternalIdAndExternalSystemId(externalProject.getExternalId(), externalProject.getExternalSystemId());
        externalProject.setId(savedPj.getId());
        externalProject = externalProjectRepository.save(externalProject);
    }
    this.syncProjectTestPlans(project.getId(), externalProject);
}
Also used : ExternalProject(io.elastest.etm.model.external.ExternalProject) DataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException)

Aggregations

ExternalProject (io.elastest.etm.model.external.ExternalProject)1 DataIntegrityViolationException (org.springframework.dao.DataIntegrityViolationException)1