Skip to content

test(FileClientImpl): add isDeleted unit tests #182

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Agaba-derrick
Copy link

FileClientImpl.isDeleted() Tests

Summary

Unit tests verifying isDeleted() behavior for:

  • File status checks (true/false for deleted/active files)
  • Null input validation
  • Protocol layer interactions

Key Tests

Type Test Cases
Status Checks ReturnsTrueForDeletedFile
ReturnsFalseForActiveFile
Input Validation ThrowsNullPointerException_WhenFileIdIsNull

Technical

  • ✅ 100% method coverage
  • 🛠 JUnit 5 + Mockito
  • ✔ Verifies:
    • Correct boolean returns
    • Exception throwing
    • Protocol layer calls

Issue

Closes #104

Signed-off-by: Agaba Derrick <agabaderrick18@gmail.com>#
@Agaba-derrick Agaba-derrick force-pushed the test/fileclientimpl-isdeleted branch from fdb17b6 to 8d94980 Compare May 23, 2025 06:58
@Agaba-derrick
Copy link
Author

@Ndacyayisenga-droid please review !

void testIsDeletedReturnsTrueForDeletedFile() throws HieroException {
final FileId fileId = FileId.fromString("1.2.3");
final FileInfoResponse fileInfoResponse = Mockito.mock(FileInfoResponse.class);
when(protocolLayerClient.executeFileInfoQuery(any(FileInfoRequest.class)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do way to much mocking to create really reasonable tests. I assume I should some documentation how to create good tests for this project to make it more easy. For for not approving your work :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Module hiero-base miss tests for functionality of FileClientImpl.isDeleted
2 participants