@ParameterizedTest @ArgumentsSource(TestCaseArgumentsProvider.class) @TestCase({"UNSPECIFIED", ""}) @TestCase({"UNCOMMITTED_READ", " with ur"}) @TestCase({"READ_COMMITTED", " with cs"}) @TestCase({"REPEATABLE_READ", " with rs"}) @TestCase({"SERIALIZABLE", " with rr"}) void withIsolation(IsolationLevel isolation, String isolationSql) { SelectStatement<Integer> sut = new SelectStatement<>(createScope(), TypeToken.of(Integer.class), from, rowMapper, projection); sut.withIsolation(isolation); when(projection.sql(any())).thenReturn("col1"); when(from.sql(any())).thenReturn(" from tab1"); assertThat(sut.sql(), is("select col1 from tab1" + isolationSql)); }
void withIsolation(IsolationLevel level) { isolationLevel = level; }
SelectStatement { void withIsolation(IsolationLevel level) { isolationLevel = level; } }
SelectStatement { void withIsolation(IsolationLevel level) { isolationLevel = level; } SelectStatement(Scope scope, TypeToken<RT> rowType, From from, RowMapper<RT> rowMapper, Projection projection); }
SelectStatement { void withIsolation(IsolationLevel level) { isolationLevel = level; } SelectStatement(Scope scope, TypeToken<RT> rowType, From from, RowMapper<RT> rowMapper, Projection projection); TypeToken<RT> rowType(); Stream<CommonTableExpression<?>> commonTableExpressions(); }
SelectStatement { void withIsolation(IsolationLevel level) { isolationLevel = level; } SelectStatement(Scope scope, TypeToken<RT> rowType, From from, RowMapper<RT> rowMapper, Projection projection); TypeToken<RT> rowType(); Stream<CommonTableExpression<?>> commonTableExpressions();  }