1 00:00:00,000 --> 00:00:02,290 [No Audio] 2 00:00:02,290 --> 00:00:03,937 In this video, we're going to see how we can fail 3 00:00:03,937 --> 00:00:07,414 tests explicitly using JUnits Assert.Fail mechanism. 4 00:00:07,414 --> 00:00:09,480 So let's pick up now where we left off. 5 00:00:09,480 --> 00:00:11,347 So if I remove those, 6 00:00:11,347 --> 00:00:14,071 [No Audio] 7 00:00:14,071 --> 00:00:15,755 and we'll just tell you about another way of being 8 00:00:15,755 --> 00:00:18,092 able to fail tests as well, 9 00:00:18,092 --> 00:00:20,258 and that's with the assert. 10 00:00:20,258 --> 00:00:22,199 [No Audio] 11 00:00:22,199 --> 00:00:23,414 fail method. 12 00:00:23,414 --> 00:00:25,956 So if you purposefully want to fail a test, then 13 00:00:25,956 --> 00:00:28,082 you can use this method to do it as well. 14 00:00:28,082 --> 00:00:29,966 And you'd usually give a message as well. 15 00:00:29,966 --> 00:00:35,096 [No Audio] 16 00:00:35,096 --> 00:00:36,863 So again right click Run. 17 00:00:36,863 --> 00:00:38,713 [No Audio] 18 00:00:38,713 --> 00:00:41,646 And now we can see we get this assertion error here. 19 00:00:41,646 --> 00:00:43,096 So there it is. 20 00:00:43,096 --> 00:00:45,515 That's how you can explicitly fail the test in JUnit.