Skip to content

[Improvement] refactor schema stubbing in TestHadoopCatalogOperations #7280

@yunchipang

Description

@yunchipang

What would you like to be improved?

In setUp() of TestHadoopCatalogOperations, we stub schema files in a fixed‐length loop:

for (int i = 10; i < 30; i++) {
doReturn(new SchemaIds(1L, 1L, (long) i))
.when(spySchemaMetaService)
.getSchemaIdByMetalakeNameAndCatalogNameAndSchemaName(
Mockito.anyString(), Mockito.anyString(), Mockito.eq("schema" + i));
}

As we add new tests that require additional schemas to be stubbed (e.g. schema30, schema31, ...) , this manual update of the loop's upper bound is inefficient and throws misleading test failures.

How should we improve?

Move the schema-stubbing action to its corresponding test.

cc @mchades

Metadata

Metadata

Assignees

Labels

0.9.1Release v0.9.11.0.0Release v1.0.0improvementImprovements on everything

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions