when(adapterProvider.get()).thenReturn(dataNode.getAdapter());
AutoAdapter adapter = new AutoAdapter(
adapterProvider,
NoopJdbcEventLogger.getInstance());
SQLTemplateAction action = (SQLTemplateAction) adapter.getAction(new SQLTemplate(
Artist.class,
"select * from artist"), dataNode);
// it is important for SQLTemplateAction to be used with unwrapped adapter, as the
// adapter class name is used as a key to the correct SQL template.
assertNotNull(action.getAdapter());
assertFalse(action.getAdapter() instanceof AutoAdapter);
assertSame(dataNode.getAdapter(), action.getAdapter());
}