Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Remove SimpleFlatMapper record mapper from database + test db configurations #621

Merged
merged 5 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ static DSLContext dbContext(
.set(dbExecutor)
.set(SQLDialect.MYSQL)
.set(new Settings().withRenderSchema(false))
.set(new DataSourceConnectionProvider(dataSource))
.set(DatabaseUtil.sfmRecordMapperProvider());
.set(new DataSourceConnectionProvider(dataSource));
if (config.getLogQueries()) {
configuration.set(new QueryLogger());
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import com.google.common.collect.ImmutableList;
import java.sql.SQLException;
import org.curioswitch.common.server.framework.database.DatabaseUtil;
import java.time.Clock;
import org.jooq.DSLContext;
import org.jooq.Record;
import org.jooq.Result;
Expand Down Expand Up @@ -71,11 +71,18 @@ public static MockDataProvider mockProvider() {
public static DSLContext newDbContext(MockDataProvider dataProvider) {
MockConnection connection = new MockConnection(dataProvider);
DSLContext db = DSL.using(connection, SQLDialect.MYSQL);
db.configuration().set(DatabaseUtil.sfmRecordMapperProvider());
db.settings().setRenderSchema(false);
return db;
}

/**
* Returns a {@link DSLContext} with a mock connection using the provided {@link MockDataProvider}
* and {@link Clock} to override the system's current time with a fixed timestamp.
*/
public static DSLContext newDbContext(MockDataProvider dataProvider, Clock clock) {
return newDbContext(dataProvider).configuration().set(clock).dsl();
}

/**
* Setup a {@link MockDataProviderStubber} which can be used to set an expectation to return
* records or throw an exception when the {@code query} is executed on the {@code provider}.
Expand Down