feat: add entityFQN query param for test case (#19541)

This commit is contained in:
Teddy 2025-01-27 17:51:06 +01:00 committed by GitHub
parent a0fcf67a4e
commit 36d8519b09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 2 deletions

View File

@ -172,6 +172,15 @@ public class TestCaseResource extends EntityResource<TestCase, TestCaseRepositor
@Schema(type = "string", example = "<E#/{entityType}/{entityFQN}/{fieldName}>"))
@QueryParam("entityLink")
String entityLink,
@Parameter(
description = "Return list of tests by entity FQN",
schema =
@Schema(
type = "string",
example =
"{serviceName}.{databaseName}.{schemaName}.{tableName}.{columnName}"))
@QueryParam("entityFQN")
String entityFQN,
@Parameter(
description = "Returns list of tests filtered by the testSuite id",
schema = @Schema(type = "string"))
@ -211,7 +220,8 @@ public class TestCaseResource extends EntityResource<TestCase, TestCaseRepositor
.addQueryParam("testSuiteId", testSuiteId)
.addQueryParam("includeAllTests", includeAllTests.toString())
.addQueryParam("testCaseStatus", status)
.addQueryParam("testCaseType", type);
.addQueryParam("testCaseType", type)
.addQueryParam("entityFQN", entityFQN);
ResourceContextInterface resourceContext = getResourceContext(entityLink, filter);
// Override OperationContext to change the entity to table and operation from VIEW_ALL to

View File

@ -481,7 +481,7 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
.withParameterValues(
List.of(
new TestCaseParameterValue().withValue("100").withName("missingCountValue")));
createAndCheckEntity(create, ADMIN_AUTH_HEADERS);
TestCase testCase = createAndCheckEntity(create, ADMIN_AUTH_HEADERS);
expectedTestCaseList.add(create);
CreateTestCase create1 =
createRequest(test, 1)
@ -549,6 +549,15 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
queryParams.put("testSuiteId", TEST_SUITE1.getId().toString());
testCaseList = getTestCases(queryParams, ADMIN_AUTH_HEADERS);
verifyTestCases(testCaseList, expectedTestCaseList, 12);
queryParams.clear();
queryParams.put("limit", 10);
queryParams.put("entityFQN", testCase.getEntityFQN());
testCaseList = getTestCases(queryParams, ADMIN_AUTH_HEADERS);
testCaseList
.getData()
.forEach(
tc -> assertEquals(testCase.getEntityFQN(), tc.getEntityFQN(), "Entity FQN mismatch"));
}
@Test