mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-28 16:08:23 +00:00
feat: add entityFQN query param for test case (#19541)
This commit is contained in:
parent
a0fcf67a4e
commit
36d8519b09
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user