Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Want to use schema from Connection #14

Closed
Kanti1702 opened this issue Dec 22, 2017 · 1 comment
Closed

Want to use schema from Connection #14

Kanti1702 opened this issue Dec 22, 2017 · 1 comment

Comments

@Kanti1702
Copy link

Kanti1702 commented Dec 22, 2017

I have legacy test codebase , which working fine in MySql.

Now when I tried that code base with MSSQL, it required me to pass schema in each class which is cumbersome. Like

@DbUnit(schema = 'dbo', configure={
   .....
})

Is this possible to use schema from Connection class, in DbUnitInterceptor like this:

void interceptFeatureMethod(IMethodInvocation invocation) throws Throwable {
    ....
    def schema = dbUnitAnnotation.schema()
    if(schema == '' || schema == null){
         dataSource.getConnection().getSchema();
     }
     tester = new DataSourceDatabaseTester(dataSource, schema ) {
    ...
}
@Kanti1702
Copy link
Author

Actually Issue #12 solved my issue, so closing this issue. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant