Skip to content

Conversation

@Agaba-derrick
Copy link

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

AccountClientImpl Delete Methods - Unit Tests

Overview

This set of unit tests targets the deleteAccount methods of the AccountClientImpl class, ensuring robust behavior around account deletion operations.

Key Features Tested

  • Successful Account Deletion
    Validates that the ProtocolLayerClient.executeAccountDeleteTransaction method is invoked once when deleting an account.

  • Account Deletion with Fund Transfer
    Tests the overloaded deleteAccount method which deletes an account and transfers remaining funds to another account, confirming correct client method invocation.

  • Exception Handling
    Checks that the methods throw or propagate expected exceptions (e.g., HieroException) when invalid parameters are passed or underlying client errors occur.

Mocking Approach

  • Uses Mockito to mock the ProtocolLayerClient dependency.
  • Applies doNothing() for stubbing void methods properly.
  • Uses assertThrows for verifying exception scenarios.
  • No modifications to production code, tests rely solely on available interfaces and expected behavior.

Issue

Closes #108

@Agaba-derrick
Copy link
Author

@Ndacyayisenga-droid @Jexsie please kindly review !

@Agaba-derrick Agaba-derrick force-pushed the Add-delete-Account-Tests branch from 84081d2 to d1bc5d8 Compare May 20, 2025 23:26
@Ndacyayisenga-droid
Copy link
Member

Signed-off-by: Agaba Derrick <[email protected]>
Signed-off-by: Agaba Derrick <[email protected]>
Signed-off-by: Agaba Derrick <[email protected]>
@Agaba-derrick Agaba-derrick force-pushed the Add-delete-Account-Tests branch from 87a4a97 to a4e308c Compare May 23, 2025 07:26
Signed-off-by: Agaba Derrick <[email protected]>
Signed-off-by: Agaba Derrick <[email protected]>
Signed-off-by: Agaba Derrick <[email protected]>
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 AccountClientImpl.deleteAccount

3 participants