Skip to content

java.lang.NoClassDefFoundError: org/dbunit/dataset/ITableMetaData when run test with@ExpectedDatabase #151

@dory2100

Description

@dory2100

My Project: Spring boot 2.3.3+testng7.1.0+spring-test-dbunit-core5.2.0

run test method as below and get NoClassDefFoundError,need further help.

@DatabaseSetup("OtpSendcode.xml")
@DatabaseTearDown("OtpSendcode.xml")
@ExpectedDatabase("expectedData.xml")
@Test(description = "token miss scenario",retryAnalyzer = RetryConfig.class)
public void test1() {
    body.put("mobileNo", "13929552529");
    body.put("_signature", "7066c781bd0e8ebc679e07e4a4f9edbbf024d6e7aa94b36644c6addd7704cd56");
    body.put("_keys", "_nonceStr,bizCode,mobileNo");
    body.put("bizCode", "otp_login");
    body.put("_nonceStr", "Bk5eY9RAFA8GLs0iUJJSuSNKUpkb7fbf");
    try {
        String res = baseTest.doPostWithJson(body);
        logger.info("res===" + res);
        Assert.assertEquals(res, "{\"code\":\"9999\",\"message\":\"Token miss \"}");
    } catch (Exception e) {
        e.printStackTrace();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions