vendredi 24 janvier 2020

How to throw this exception in a test?

I am trying to test a java.sql.SQLException handler which unwraps the exceptions like below. However I'm not sure how I would throw this exception in a test. (-> e (.getNextException) (.getMessage) (.startsWith "ERROR: duplicate key value")) current mock (.getNextException returns nil on this): (throw (SQLException. "ERROR: duplicate key value"))

Aucun commentaire:

Enregistrer un commentaire