@Nullable open static fun retrieveDataSource(testContext: TestContext, @Nullable name: String): DataSource
Retrieve the DataSource to use for the supplied TestContext.
The following algorithm is used to retrieve the DataSource from the org.springframework.context.ApplicationContext of the supplied test context:
DataSource by type and name, if the supplied name is non-empty, throwing a BeansException if the named DataSource does not exist. DataSource by type. DataSource by type. DataSource by type and the default data source name.
testContext - the test context for which the DataSource should be retrieved; never null
name - the name of the DataSource to retrieve; may be null or empty
BeansException - if an error occurs while retrieving an explicitly named DataSource
Return
the DataSource to use, or null if not found