fake-sftp-server-rule
fake-sftp-server-rule copied to clipboard
How to simulate failure scenario ?
The source code that I am creating unit tests has a lot of try catch block. How do I simulate failure scenario, so I can cover those catch blocks ? Is there I way we can customize the response or reply code of the different SFTP commands ?
Can you give an example of such a failure scenario?
Can you give an example of such a failure scenario?
Let"s say there is a network communication failure.
For simulating network failures I suggest to use a proxy that can simulate network errors. For network errors you usually don't get an answer from the SFTP server at all and therefore this behaviour is not something I would like tom implement in the SFTP server. Does this answer help you?