-
Couldn't load subscription status.
- Fork 24
tests for functionality of SmartContractClientImpl.createContract #187
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Atwijukire Ariho Seth <[email protected]>
|
Hello @Ndacyayisenga-droid or @hendrikebbers , may you please review the changes added here and tell me incase anything needs to be added or removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IFileReader creates unneeded complexity and is only used for mocks. We should try to avoid it.
| import java.io.IOException; | ||
| import java.nio.file.Path; | ||
|
|
||
| public interface IFileReader { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with this approach. Instead of mocking the Fiel read in the test you can easily create a test file and use that one in the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review, and I've worked on them as requested.
Signed-off-by: Atwijukire Ariho Seth <[email protected]>
|
Thanks @hendrikebbers for the suggestions, Please check thru the updated code and feel free to leave a review incase of any changes needed. |
| import com.openelements.hiero.base.NftClient; | ||
| import com.openelements.hiero.base.SmartContractClient; | ||
| import com.openelements.hiero.base.TopicClient; | ||
| import com.openelements.hiero.base.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use * imports
| import com.openelements.hiero.base.HieroContext; | ||
| import com.openelements.hiero.base.NftClient; | ||
| import com.openelements.hiero.base.SmartContractClient; | ||
| import com.openelements.hiero.base.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use * imports
Signed-off-by: Atwijukire Ariho Seth <[email protected]>
|
Ohh yeah!, that's true |
Signed-off-by: Atwijukire Ariho Seth <[email protected]>
Signed-off-by: Atwijukire Ariho Seth <[email protected]>
A new test class
SmartContractClientImplTestwas created forSmartContractClientImpland tests for the three overloadedcreateContractmethods. The coverage for all input types (i.e., FileId, byte array, and Path) has been tested and both positive and negative scenarios.For tests that require a path parameter, test file is created first i.e.
tempPath= Files.createTempFile("testContract", ".bin");which is used during the tests and then is later on deleted after the testView issue here