spring @sqlgroup with multiple datasource -
i trying use @sql , @sqlgroup on unit test want annotation use datasource different name other default datasource.
how can achieve this?
from transaction management @sql section of spring reference manual:
if algorithms used
sqlscriptstestexecutionlistenerdetectdatasource,platformtransactionmanager, infer transaction semantics not suit needs, may specify explicit names viadatasource,transactionmanagerattributes of@sqlconfig.
for example:
@sqlgroup({ @sql(scripts = "script1.sql", config = @sqlconfig(datasource = "datasource1", transactionmanager = "txmgr1")), @sql(scripts = "script2.sql", config = @sqlconfig(datasource = "datasource2", transactionmanager = "txmgr2")) }) regards,
sam (author of spring testcontext framework)
Comments
Post a Comment