Search in sources :

Example 6 with DbVerification

use of com.axway.ats.rbv.clients.DbVerification in project ats-framework by Axway.

the class Test_DbVerification method checkFieldValueRegexPositive.

@Test
public void checkFieldValueRegexPositive() throws RbvException {
    DbVerification fsVerification = new DbVerification(new DbSearchTerm(""), provider);
    fsVerification.checkFieldValueRegex("", "key1", "val.*");
    fsVerification.verifyDbDataExists();
}
Also used : 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 7 with DbVerification

use of com.axway.ats.rbv.clients.DbVerification 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 8 with DbVerification

use of com.axway.ats.rbv.clients.DbVerification in project ats-framework by Axway.

the class Test_DbVerification method clearRulesTest.

@Test
public void clearRulesTest() throws RbvException {
    DbVerification dbVerification = new DbVerification(new DbSearchTerm(""), provider);
    try {
        //adding rule with wrong value and expecting RBVException exception 
        dbVerification.checkFieldValueEquals("", "key1", "wrongValue");
        dbVerification.verifyDbDataExists();
        Assert.fail();
    } catch (RbvException e) {
    //this is the expected behavior
    }
    //clear all rules
    dbVerification.clearRules();
    //adding rule with existing value
    dbVerification.checkFieldValueEquals("", "key1", "value00");
    dbVerification.verifyDbDataExists();
}
Also used : RbvException(com.axway.ats.rbv.model.RbvException) 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 9 with DbVerification

use of com.axway.ats.rbv.clients.DbVerification in project ats-framework by Axway.

the class Test_DbVerification method checkFieldValueEqualsStringNegative.

@Test(expected = RbvVerificationException.class)
public void checkFieldValueEqualsStringNegative() throws RbvException {
    DbVerification fsVerification = new DbVerification(new DbSearchTerm(""), provider);
    fsVerification.checkFieldValueEquals("", "key1", "value");
    fsVerification.verifyDbDataExists();
}
Also used : 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 10 with DbVerification

use of com.axway.ats.rbv.clients.DbVerification in project ats-framework by Axway.

the class Test_DbVerification method checkFieldValueDoesNotEqualNumericNegative.

@Test
public void checkFieldValueDoesNotEqualNumericNegative() throws RbvException {
    DbVerification fsVerification = new DbVerification(new DbSearchTerm(""), provider);
    fsVerification.checkFieldValueDoesNotEqual("numeric", "key", 0);
    fsVerification.verifyDbDataExists();
}
Also used : 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)27 DbVerification (com.axway.ats.rbv.clients.DbVerification)27 DbSearchTerm (com.axway.ats.rbv.db.DbSearchTerm)27 Test (org.junit.Test)27 MockDbEncryptor (com.axway.ats.rbv.db.MockDbEncryptor)4 RbvException (com.axway.ats.rbv.model.RbvException)1 Calendar (java.util.Calendar)1