Use new exception types in KeyProvider class.
[platform/core/security/key-manager.git] / tests / test-key-provider.cpp
index 433e8ec..92f7e07 100644 (file)
@@ -1,5 +1,6 @@
 #define BOOST_TEST_MODULE KEY_MANAGER_TEST
 #include <boost/test/unit_test.hpp>
+#include <exception.h>
 #include <key-provider.h>
 #include <test_common.h>
 #include <iostream>
@@ -36,7 +37,7 @@ BOOST_AUTO_TEST_CASE(KeyDomainKekInvalidPassword){
     BOOST_REQUIRE_NO_THROW(rb_test =
             CKM::KeyProvider::generateDomainKEK(USERNAME_LONG, PASSWORD));
     BOOST_REQUIRE_THROW(keyProvider = CKM::KeyProvider(rb_test, INCORRECT_PASSWORD),
-            CKM::KeyProvider::Exception::PassWordError);
+            CKM::Exc::AuthenticationFailed);
     BOOST_REQUIRE_MESSAGE(!keyProvider.isInitialized(),
             "KeyProvider not created, but initialized");
 }
@@ -114,7 +115,7 @@ BOOST_AUTO_TEST_CASE(KeyReencrypt_incorrect_password){
     BOOST_REQUIRE_NO_THROW(rb_test =
             CKM::KeyProvider::generateDomainKEK(USERNAME_LONG, PASSWORD));
     BOOST_REQUIRE_THROW((rb_test = CKM::KeyProvider::reencrypt(rb_test, INCORRECT_PASSWORD,
-            NEW_PASSWORD)), CKM::KeyProvider::Exception::PassWordError);
+            NEW_PASSWORD)), CKM::Exc::AuthenticationFailed);
 }
 
 BOOST_AUTO_TEST_CASE(KeyGetPureDEK_after_reencrypt){