-
Notifications
You must be signed in to change notification settings - Fork 24
Implemented tests for missing functionalities in FileClientImpl.createFile() #133
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
Conversation
…eFile() Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
| .thenReturn(fileCreateResult); | ||
| when(fileCreateResult.fileId()).thenReturn(fileId); | ||
| when(protocolLayerClient.executeFileAppendRequestTransaction(any(FileAppendRequest.class))) | ||
| .thenReturn(any(FileAppendResult.class)); |
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 would suggest we avoid any() in when for Return Type since thenReturn expects a specific object. Replace it with a mocked FileAppendResult object
final FileAppendResult fileAppendResult = Mockito.mock(FileAppendResult.class);
when(protocolLayerClient.executeFileAppendRequestTransaction(any(FileAppendRequest.class))) .thenReturn(fileAppendResult);
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.
Done
| import java.time.Instant; | ||
|
|
||
| import static org.mockito.ArgumentMatchers.any; | ||
| import static org.mockito.Mockito.*; |
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.
Remove the asterisk wildcard
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.
Done
hiero-enterprise-base/src/test/java/com/openelements/hiero/base/test/FileClientImplTest.java
Show resolved
Hide resolved
|
Thanks for working on this @manishdait! Just a few main comments! |
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Implemented test to validate the functionality of the
createFile()method within theFileClientImplclass, covering both successful and failure scenarios.Closes: #99