String insert_sql = "INSERT INTO orders (ID, NAME) VALUES (1, \"KIKI\")";
String expect_sql = "INSERT INTO orders (ID, NAME, tenant)" + //
"\nVALUES (1, 'KIKI', 123)";
{
MySqlWallProvider provider = new MySqlWallProvider(config_callback);
WallCheckResult checkResult = provider.check(insert_sql);
Assert.assertEquals(0, checkResult.getViolations().size());
String resultSql = SQLUtils.toSQLString(checkResult.getStatementList(), JdbcConstants.MYSQL);
Assert.assertEquals(expect_sql, resultSql);
}
{
WallProvider.setTenantValue(123);
MySqlWallProvider provider = new MySqlWallProvider(config);
WallCheckResult checkResult = provider.check(insert_sql);
Assert.assertEquals(0, checkResult.getViolations().size());
String resultSql = SQLUtils.toSQLString(checkResult.getStatementList(), JdbcConstants.MYSQL);
Assert.assertEquals(expect_sql, resultSql);
}
}