MINOR - fix test suite migration (#21320)

* fix: don't add relationship if test suite exists

* style: ran java linting
This commit is contained in:
Teddy 2025-05-27 12:40:01 +02:00 committed by GitHub
parent ca812852d6
commit f2a67b8501
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -529,27 +529,29 @@ public class MigrationUtil {
"nameHash",
newExecutableTestSuite,
newExecutableTestSuite.getFullyQualifiedName());
// add relationship between executable TestSuite with Table
testSuiteRepository.addRelationship(
newExecutableTestSuite.getExecutableEntityReference().getId(),
newExecutableTestSuite.getId(),
Entity.TABLE,
TEST_SUITE,
Relationship.CONTAINS);
// add relationship between all the testCases that are created against a table with
// native
// test suite.
for (TestCase testCase : testCases) {
testSuiteRepository.addRelationship(
newExecutableTestSuite.getId(),
testCase.getId(),
TEST_SUITE,
TEST_CASE,
Relationship.CONTAINS);
}
} catch (Exception ex) {
LOG.warn(String.format("TestSuite %s exists", nativeTestSuiteFqn));
}
// add relationship between executable TestSuite with Table
testSuiteRepository.addRelationship(
newExecutableTestSuite.getExecutableEntityReference().getId(),
newExecutableTestSuite.getId(),
Entity.TABLE,
TEST_SUITE,
Relationship.CONTAINS);
// add relationship between all the testCases that are created against a table with native
// test suite.
for (TestCase testCase : testCases) {
testSuiteRepository.addRelationship(
newExecutableTestSuite.getId(),
testCase.getId(),
TEST_SUITE,
TEST_CASE,
Relationship.CONTAINS);
}
}
}
} catch (Exception ex) {