use of org.jooq.Configuration in project spring-boot by spring-projects.
the class JooqExceptionTranslatorTests method exceptionTranslation.
@Test
public void exceptionTranslation() {
ExecuteContext context = mock(ExecuteContext.class);
Configuration configuration = mock(Configuration.class);
given(context.configuration()).willReturn(configuration);
given(configuration.dialect()).willReturn(this.dialect);
given(context.sqlException()).willReturn(this.sqlException);
this.exceptionTranslator.exception(context);
ArgumentCaptor<RuntimeException> captor = ArgumentCaptor.forClass(RuntimeException.class);
verify(context).exception(captor.capture());
assertThat(captor.getValue()).isInstanceOf(BadSqlGrammarException.class);
}
Aggregations