I have a question about implementing an outcome which is an error
(exception) to the user, like the following:

Scenario: user without permission creating a Product
Given system is running
And user is logged in whithout administrator privileges
When user creates a Product
Then user should get permission denied error

I've created a UserShouldGetPermissionDeniedErrorCreatingProduct outcome,
which implementation is:

   public void verify(World world) {
       try {
           ensureThrows(PermissionDeniedException.class, new Block(){
               public void run() throws Exception {
                   // the statement which throw exception....
               }
           });
       } catch (Exception e) {
           // what to do here?
       }
   }

Is it a good idea? Anyone could opine about this, please?
Thanks.

Happy New Year!
Cheers.

--
______________________
Alexandre Martins Nunes

Reply via email to