Skip to content

Conversation

Agaba-derrick
Copy link

@Agaba-derrick Agaba-derrick commented May 20, 2025

FileClientImpl.isDeleted() Tests

Summary

Test Coverage

  • Core functionality

    • Returns true for deleted files
    • Returns false for active files
  • Error handling

    • Validates null FileId input (throws NullPointerException)
    • Handles protocol layer failures (throws HieroException)
  • Integration verification

    • Correct FileInfoRequest construction
    • Proper FileInfoResponse handling

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 :(

Copy link
Author

Choose a reason for hiding this comment

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

hey @hendrikebbers Apologies for the late reply I can resolve this using real objects

Signed-off-by: Agaba Derrick <agabaderrick18@gmail.com>
@Agaba-derrick
Copy link
Author

@hendrikebbers is this better ?

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