tests for functionality of SmartContractClientImpl.createContract#187
tests for functionality of SmartContractClientImpl.createContract#187Ariho-Seth wants to merge 9 commits intoOpenElements:mainfrom
Conversation
Signed-off-by: Atwijukire Ariho Seth <arihoseth18@gmail.com>
|
Hello @Ndacyayisenga-droid or @hendrikebbers , may you please review the changes added here and tell me incase anything needs to be added or removed |
hendrikebbers
left a comment
There was a problem hiding this comment.
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.
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.
Thanks for the review, and I've worked on them as requested.
Signed-off-by: Atwijukire Ariho Seth <arihoseth18@gmail.com>
|
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.
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.
Please do not use * imports
Signed-off-by: Atwijukire Ariho Seth <120330466+Ariho-Seth@users.noreply.github.com>
|
Ohh yeah!, that's true |
Signed-off-by: Atwijukire Ariho Seth <120330466+Ariho-Seth@users.noreply.github.com>
Signed-off-by: Atwijukire Ariho Seth <120330466+Ariho-Seth@users.noreply.github.com>
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