You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because DuplicateKey is deprecated, I would like to write my tests using their suggested DuplicateKeyException. I am trying to write a test that goes something like this:
"fail to add a duplicate user" in {
cleanDb {
create("joe", "blow", "jb@email.com")
create("same", "email", "jb@email.com") must beFailedTry.withThrowable[DuplicateKeyException]
}
}
but the driver is still throwing the specific DuplicateKey. Should I just use the deprecated method for now? Is there a better way to wite the test given the deprecation?
The text was updated successfully, but these errors were encountered:
Firstly, I realize this is most likely not a bug. I'm looking for an alternative solution.
The Mongo java driver (via Casbah) throws the following exception:
Because
DuplicateKey
is deprecated, I would like to write my tests using their suggestedDuplicateKeyException
. I am trying to write a test that goes something like this:but the driver is still throwing the specific
DuplicateKey
. Should I just use the deprecated method for now? Is there a better way to wite the test given the deprecation?The text was updated successfully, but these errors were encountered: