Skip to content

Commit

Permalink
Remove deprecated QueryAssert.assertThat
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed May 22, 2024
1 parent 3de7c91 commit facd193
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,6 @@ private QueryAssert(QueryResult actual)
this.columnTypes = actual.getColumnTypes();
}

/**
* Use {@link Assertions#assertThat(AssertProvider)}.
*/
@CheckReturnValue
@Deprecated
public static QueryAssert assertThat(QueryResult queryResult)
{
return new QueryAssert(queryResult);
}

/**
* @deprecated Use {@link #assertQueryFailure(QueryCallback)} instead.
*/
@Deprecated
@CheckReturnValue
public static QueryExecutionAssert assertThat(QueryCallback queryCallback)
{
QueryExecutionException executionException = null;
try {
queryCallback.executeQuery();
}
catch (QueryExecutionException e) {
executionException = e;
}
return new QueryExecutionAssert(ofNullable(executionException));
}

@CheckReturnValue
public static AbstractThrowableAssert<?, ? extends Throwable> assertQueryFailure(QueryCallback queryCallback)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Maps.newHashMap;
import static io.trino.tempto.assertions.QueryAssert.assertThat;
import static io.trino.tempto.context.ThreadLocalTestContextHolder.testContext;
import static io.trino.tempto.fulfillment.table.MutableTablesState.mutableTablesState;
import static io.trino.tempto.internal.convention.ConventionTestsUtils.getConventionTestResultsDumpPath;
Expand All @@ -55,6 +54,7 @@
import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
import static org.assertj.core.api.Assertions.assertThat;
import static org.slf4j.LoggerFactory.getLogger;

public class SqlQueryConventionBasedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.common.collect.Lists;
import io.trino.tempto.assertions.QueryAssert;
import org.assertj.core.api.AssertProvider;
import org.assertj.core.api.Assertions;

import java.sql.JDBCType;
import java.sql.ResultSet;
Expand Down Expand Up @@ -156,7 +157,7 @@ public String toString()
@Override
public QueryAssert assertThat()
{
return QueryAssert.assertThat(this);
return Assertions.assertThat(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import io.trino.tempto.query.QueryExecutionException;
import io.trino.tempto.query.QueryExecutor;

import static io.trino.tempto.assertions.QueryAssert.assertThat;
import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ import java.sql.ResultSet
import static com.google.common.collect.Iterables.getOnlyElement
import static io.trino.tempto.assertions.QueryAssert.Row.row
import static io.trino.tempto.assertions.QueryAssert.anyOf
import static io.trino.tempto.assertions.QueryAssert.assertThat
import static io.trino.tempto.internal.configuration.TestConfigurationFactory.TEST_CONFIGURATION_URIS_KEY
import static java.nio.charset.StandardCharsets.UTF_8
import static java.sql.JDBCType.BIGINT
import static java.sql.JDBCType.INTEGER
import static java.sql.JDBCType.VARBINARY
import static java.sql.JDBCType.VARCHAR
import static org.assertj.core.api.Assertions.assertThat;

class QueryAssertTest
extends Specification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import java.sql.Connection
import static JdbcUtils.connection
import static JdbcUtils.registerDriver
import static io.trino.tempto.assertions.QueryAssert.Row.row
import static io.trino.tempto.assertions.QueryAssert.assertThat
import static io.trino.tempto.internal.configuration.TestConfigurationFactory.TEST_CONFIGURATION_URIS_KEY
import static java.sql.JDBCType.INTEGER
import static java.sql.JDBCType.VARCHAR
import static org.assertj.core.api.Assertions.assertThat;

class JdbcQueryExecutorTest
extends Specification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
import java.util.List;

import static io.trino.tempto.assertions.QueryAssert.Row.row;
import static io.trino.tempto.assertions.QueryAssert.assertThat;
import static io.trino.tempto.fulfillment.table.TableRequirements.immutableTable;
import static io.trino.tempto.query.QueryExecutor.query;
import static java.lang.String.format;
import static java.sql.JDBCType.BIGINT;
import static java.sql.JDBCType.DOUBLE;
import static java.sql.JDBCType.VARCHAR;
import static org.assertj.core.api.Assertions.assertThat;

public class CassandraQueryTest
extends ProductTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
import java.time.LocalDate;

import static io.trino.tempto.assertions.QueryAssert.Row.row;
import static io.trino.tempto.assertions.QueryAssert.assertThat;
import static io.trino.tempto.query.QueryExecutor.param;
import static io.trino.tempto.query.QueryExecutor.query;
import static java.sql.JDBCType.DATE;
import static java.sql.JDBCType.INTEGER;
import static java.sql.JDBCType.VARCHAR;
import static org.assertj.core.api.Assertions.assertThat;

public class ExampleQueryAssertTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
import org.testng.annotations.Test;

import static io.trino.tempto.assertions.QueryAssert.Row.row;
import static io.trino.tempto.assertions.QueryAssert.assertThat;
import static io.trino.tempto.fulfillment.table.TableRequirements.immutableTable;
import static io.trino.tempto.fulfillment.table.kafka.KafkaMessageContentsBuilder.contentsBuilder;
import static io.trino.tempto.query.QueryExecutor.query;
import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;

public class KafkaQueryTest
extends ProductTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
import java.util.List;

import static io.trino.tempto.assertions.QueryAssert.Row.row;
import static io.trino.tempto.assertions.QueryAssert.assertThat;
import static io.trino.tempto.fulfillment.table.ImmutableTablesState.immutableTablesState;
import static io.trino.tempto.fulfillment.table.TableHandle.tableHandle;
import static io.trino.tempto.fulfillment.table.jdbc.RelationalTableDefinition.relationalTableDefinition;
import static org.assertj.core.api.Assertions.assertThat;

public class PostgresqlQueryTest
extends ProductTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

import static io.trino.tempto.Requirements.allOf;
import static io.trino.tempto.assertions.QueryAssert.Row.row;
import static io.trino.tempto.assertions.QueryAssert.assertThat;
import static io.trino.tempto.context.ThreadLocalTestContextHolder.testContext;
import static io.trino.tempto.context.ThreadLocalTestContextHolder.testContextIfSet;
import static io.trino.tempto.fulfillment.table.MutableTableRequirement.State.CREATED;
Expand Down

0 comments on commit facd193

Please sign in to comment.