### Question:
JooqFactory { public Configuration build(Environment environment, DataSourceFactory factory) throws ClassNotFoundException { return build(environment, factory, DEFAULT_NAME); }  Optional<SQLDialect> getDialect(); void setDialect(Optional<SQLDialect> dialect); @Deprecated boolean isLogExecutedSql(); @Deprecated void setLogExecutedSql(boolean logExecutedSql); boolean isRenderSchema(); void setRenderSchema(boolean renderSchema); RenderNameStyle getRenderNameStyle(); void setRenderNameStyle(RenderNameStyle renderNameStyle); RenderKeywordStyle getRenderKeywordStyle(); void setRenderKeywordStyle(RenderKeywordStyle renderKeywordStyle); boolean isRenderFormatted(); void setRenderFormatted(boolean renderFormatted); ParamType getParamType(); void setParamType(ParamType paramType); StatementType getStatementType(); void setStatementType(StatementType statementType); boolean isExecuteLogging(); void setExecuteLogging(boolean executeLogging); boolean isExecuteWithOptimisticLocking(); void setExecuteWithOptimisticLocking(boolean executeWithOptimisticLocking); boolean isAttachRecords(); void setAttachRecords(boolean attachRecords); boolean isUpdatablePrimaryKeys(); void setUpdatablePrimaryKeys(boolean updatablePrimaryKeys); boolean isFetchWarnings(); void setFetchWarnings(boolean fetchWarnings); Configuration build(Environment environment, DataSourceFactory factory); Configuration build(Environment environment, PooledDataSourceFactory factory, String name);  }### Answer:
@Test public void buildsConfigurationUsingDataSourceFactory() throws Exception { Configuration config = factory.build(environment, dataSourceFactory); DataSourceConnectionProvider provider = (DataSourceConnectionProvider) config.connectionProvider(); assertThat(provider.dataSource()).isEqualTo(managedDataSource); }
@Test public void buildsConfigurationUsingDataSourceFactoryAndName() throws Exception { Configuration config = factory.build(environment, dataSourceFactory, DATASOURCE_NAME); DataSourceConnectionProvider provider = (DataSourceConnectionProvider) config.connectionProvider(); assertThat(provider.dataSource()).isEqualTo(managedDataSource); }
@Test public void managesManagedDataSource() throws Exception { factory.build(environment, dataSourceFactory); verify(lifecycle).manage(managedDataSource); }