Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-12130. Improve assertion compatibility with old Hadoop #7738

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ private void validateListingForFile(Path f,
Assertions.assertThat(statusList)
.describedAs(msg)
.hasSize(1);
Assertions.assertThat(statusList.get(0).getPath())
Assertions.assertThatObject(statusList.get(0).getPath())
.describedAs("path returned should match with the input path")
.isEqualTo(f);
Assertions.assertThat(statusList.get(0).isFile())
Expand Down Expand Up @@ -471,7 +471,7 @@ private void verifyStatusArrayMatchesFile(Path f, FileStatus[] status) {
* @param fileStatus status to validate
*/
private void assertIsNamedFile(Path f, FileStatus fileStatus) {
Assertions.assertThat(fileStatus.getPath())
Assertions.assertThatObject(fileStatus.getPath())
.withFailMessage("Wrong pathname in " + fileStatus)
.isEqualTo(f);
Assertions.assertThat(fileStatus.isFile())
Expand Down Expand Up @@ -569,15 +569,15 @@ public void testListStatusFiltering() throws Throwable {

MatchesNameFilter file1Filter = new MatchesNameFilter("file-1.txt");
result = verifyListStatus(1, parent, file1Filter);
Assertions.assertThat(result[0].getPath())
Assertions.assertThatObject(result[0].getPath())
.isEqualTo(file1);

verifyListStatus(0, file1, NO_PATHS);
result = verifyListStatus(1, file1, ALL_PATHS);
Assertions.assertThat(result[0].getPath())
Assertions.assertThatObject(result[0].getPath())
.isEqualTo(file1);
result = verifyListStatus(1, file1, file1Filter);
Assertions.assertThat(result[0].getPath())
Assertions.assertThatObject(result[0].getPath())
.isEqualTo(file1);

// empty subdirectory
Expand Down Expand Up @@ -608,15 +608,15 @@ public void testListLocatedStatusFiltering() throws Throwable {

MatchesNameFilter file1Filter = new MatchesNameFilter("file-1.txt");
result = verifyListLocatedStatus(xfs, 1, parent, file1Filter);
Assertions.assertThat(result.get(0).getPath())
Assertions.assertThatObject(result.get(0).getPath())
.isEqualTo(file1);

verifyListLocatedStatus(xfs, 0, file1, NO_PATHS);
verifyListLocatedStatus(xfs, 1, file1, ALL_PATHS);
Assertions.assertThat(result.get(0).getPath())
Assertions.assertThatObject(result.get(0).getPath())
.isEqualTo(file1);
verifyListLocatedStatus(xfs, 1, file1, file1Filter);
Assertions.assertThat(result.get(0).getPath())
Assertions.assertThatObject(result.get(0).getPath())
.isEqualTo(file1);
verifyListLocatedStatusNextCalls(xfs, 1, file1, file1Filter);

Expand Down
Loading