+ 2
What will be the output of following test case?
Hi, I need to know the output of this negative test case which is written for Deserialize Employee class. @Test(expected = FileNotFoundException.class) public void TestCaseForDeserialize() throws ClassNotFoundException, IOException { serializer.deserialize("invalid name"); } Thanks in advance.
2 Respuestas
+ 1
I found the answer.
This test case will pass without any error.
Because it's expected a exception of FileNotFoundException. If the actual exception is FileNotFoundException this test case will pass. If the actual exception is other than that(FileNotFoundException) this test case will fail.
If there any wrong point in my answer please correct me😊.
0
however, we don't know what .deserialize() really throws