Search in sources :

Example 1 with MockDbEncryptor

use of com.axway.ats.rbv.db.MockDbEncryptor in project ats-framework by Axway.

the class Test_DbVerification method checkDencryptorIsUnsetNegative.

@Test(expected = RbvVerificationException.class)
public void checkDencryptorIsUnsetNegative() throws RbvException {
    DbVerification fsVerification = new DbVerification(new DbSearchTerm(""), provider);
    fsVerification.checkFieldValueEquals("asd", "key0", "value00");
    // the mock encryptor changes all letters to capital case
    fsVerification.setDbEncryptor(new MockDbEncryptor());
    fsVerification.checkFieldValueEquals("", "key1", "VALUE00");
    // did not remove the encryptor, this will result in error in the next check
    fsVerification.checkFieldValueEquals("", "key2", "value00");
    fsVerification.verifyDbDataExists();
}
Also used : MockDbEncryptor(com.axway.ats.rbv.db.MockDbEncryptor) DbSearchTerm(com.axway.ats.rbv.db.DbSearchTerm) DbVerification(com.axway.ats.rbv.clients.DbVerification) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 2 with MockDbEncryptor

use of com.axway.ats.rbv.db.MockDbEncryptor in project ats-framework by Axway.

the class Test_DbVerification method checkFieldValueEqualsEncryptedStringNegative.

@Test(expected = RbvVerificationException.class)
public void checkFieldValueEqualsEncryptedStringNegative() throws RbvException {
    DbVerification fsVerification = new DbVerification(new DbSearchTerm(""), provider);
    // the mock encryptor changes all letters to capital case 
    fsVerification.setDbEncryptor(new MockDbEncryptor());
    fsVerification.checkFieldValueEquals("", "key1", "VaLUE00");
    fsVerification.verifyDbDataExists();
}
Also used : MockDbEncryptor(com.axway.ats.rbv.db.MockDbEncryptor) DbSearchTerm(com.axway.ats.rbv.db.DbSearchTerm) DbVerification(com.axway.ats.rbv.clients.DbVerification) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 3 with MockDbEncryptor

use of com.axway.ats.rbv.db.MockDbEncryptor in project ats-framework by Axway.

the class Test_DbVerification method checkDencryptorIsUnsetPositive.

@Test
public void checkDencryptorIsUnsetPositive() throws RbvException {
    DbVerification fsVerification = new DbVerification(new DbSearchTerm(""), provider);
    fsVerification.checkFieldValueEquals("asd", "key0", "value00");
    // the mock encryptor changes all letters to capital case
    fsVerification.setDbEncryptor(new MockDbEncryptor());
    fsVerification.checkFieldValueEquals("", "key1", "VALUE00");
    // remove the encryptor
    fsVerification.setDbEncryptor(null);
    fsVerification.checkFieldValueEquals("", "key2", "value00");
    fsVerification.verifyDbDataExists();
}
Also used : MockDbEncryptor(com.axway.ats.rbv.db.MockDbEncryptor) DbSearchTerm(com.axway.ats.rbv.db.DbSearchTerm) DbVerification(com.axway.ats.rbv.clients.DbVerification) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 4 with MockDbEncryptor

use of com.axway.ats.rbv.db.MockDbEncryptor in project ats-framework by Axway.

the class Test_DbVerification method checkFieldValueEqualsEncryptedStringPositive.

@Test
public void checkFieldValueEqualsEncryptedStringPositive() throws RbvException {
    DbVerification fsVerification = new DbVerification(new DbSearchTerm(""), provider);
    // the mock encryptor changes all letters to capital case 
    fsVerification.setDbEncryptor(new MockDbEncryptor());
    fsVerification.checkFieldValueEquals("", "key1", "VALUE00");
    fsVerification.verifyDbDataExists();
}
Also used : MockDbEncryptor(com.axway.ats.rbv.db.MockDbEncryptor) DbSearchTerm(com.axway.ats.rbv.db.DbSearchTerm) DbVerification(com.axway.ats.rbv.clients.DbVerification) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Aggregations

BaseTest (com.axway.ats.rbv.BaseTest)4 DbVerification (com.axway.ats.rbv.clients.DbVerification)4 DbSearchTerm (com.axway.ats.rbv.db.DbSearchTerm)4 MockDbEncryptor (com.axway.ats.rbv.db.MockDbEncryptor)4 Test (org.junit.Test)4