{
DbTypeManager dbTypeManager = mock(DbTypeManager.class);
for (DbType type : types)
{
when(dbTypeManager.lookup(connection, type.getId(), type.getName())).thenReturn(type);
}
for (DbType type : unknownTypes)
{
when(dbTypeManager.lookup(connection, type.getId(), type.getName())).thenThrow(new UnknownDbTypeException(type.getId(), type.getName()));