Skip to content

Add Missing Tests for delete Account Functionality #179

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 7 commits into
base: main
Choose a base branch
from

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

Hey @Agaba-derrick. Thanks for the contribution! Could you sign the DCO https://github.com/OpenElements/hiero-enterprise-java/pull/179/checks?check_run_id=42593910068

Signed-off-by: Agaba Derrick <agabaderrick18@gmail.com>
Signed-off-by: Agaba Derrick <agabaderrick18@gmail.com>
Signed-off-by: Agaba Derrick <agabaderrick18@gmail.com>
Signed-off-by: Agaba Derrick <agabaderrick18@gmail.com>
@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 <agabaderrick18@gmail.com>
Signed-off-by: Agaba Derrick <agabaderrick18@gmail.com>
Signed-off-by: Agaba Derrick <agabaderrick18@gmail.com>
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