use of org.eclipse.scout.rt.server.jdbc.style.ISqlStyle in project scout.rt by eclipse.
the class StatementProcessorCreateSqlDumpTest method runDump.
private void runDump(String expected, StatementType type, String statement) {
ISqlStyle style = Mockito.mock(ISqlStyle.class);
Mockito.when(style.buildBindFor(23, null)).thenReturn(new SqlBind(4, 23));
Mockito.when(style.toPlainText(23)).thenReturn("23");
Mockito.when(style.buildBindFor("lorem", null)).thenReturn(new SqlBind(1, "lorem"));
Mockito.when(style.toPlainText("lorem")).thenReturn("'lorem'");
ISqlService callerService = Mockito.mock(ISqlService.class);
Mockito.when(callerService.getSqlStyle()).thenReturn(style);
Object[] bindBases = new Object[] { new NVPair("myKey", 23), new NVPair("myText", "lorem") };
P_StatementProcessor_UnderTest statementProcessor = new P_StatementProcessor_UnderTest(callerService, statement, bindBases);
String dump = statementProcessor.getDump(type);
assertEquals(type.name() + " dump", expected, dump);
}
Aggregations