I am new to Cucumber, and am trying to write some functional tests. I want to know the Cucumber equivalency of JUnit's Expectations(). In Expectations(), you're able to expect an Exception (or just result) to be returned when some service method is called. I want to know how to force an exception of a service in Cucumber?
Asked
Active
Viewed 187 times
0
-
1Possible duplicate of [Cucumber JVM : Test if the correct exception is thrown](http://stackoverflow.com/questions/17272161/cucumber-jvm-test-if-the-correct-exception-is-thrown) – MikeJRamsey56 Nov 20 '16 at 20:21
-
@MikeJRamsey56 so long story short, I need to test my restReponse which depends on whether an external service I'm calling is throwing a 400 or 500 response. But I don't see any way I can possibly throw an exception in that service that I'm trying to call.. – liuchuanhung Nov 21 '16 at 01:48
-
Take a look at [Doug's response](http://stackoverflow.com/questions/3752528/how-to-simulate-an-http-500-error-on-my-asp-net-app) – MikeJRamsey56 Nov 21 '16 at 02:53