Rely on auto-boxing in tests
This commit is contained in:
@@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Mark Paluch
|
||||
* @author Mingyuan Wu
|
||||
*/
|
||||
public abstract class AbstractDatabaseClientIntegrationTests {
|
||||
abstract class AbstractDatabaseClientIntegrationTests {
|
||||
|
||||
private ConnectionFactory connectionFactory;
|
||||
|
||||
@@ -88,10 +88,8 @@ public abstract class AbstractDatabaseClientIntegrationTests {
|
||||
.map(row -> row.get("id"))
|
||||
.first()
|
||||
.as(StepVerifier::create)
|
||||
.assertNext(actual -> {
|
||||
assertThat(actual).isInstanceOf(Number.class);
|
||||
assertThat(((Number) actual).intValue()).isEqualTo(42055);
|
||||
}).verifyComplete();
|
||||
.assertNext(actual -> assertThat(actual).isInstanceOf(Number.class).isEqualTo(42055))
|
||||
.verifyComplete();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
public abstract class AbstractTransactionalDatabaseClientIntegrationTests {
|
||||
abstract class AbstractTransactionalDatabaseClientIntegrationTests {
|
||||
|
||||
private ConnectionFactory connectionFactory;
|
||||
|
||||
@@ -184,8 +184,8 @@ public abstract class AbstractTransactionalDatabaseClientIntegrationTests {
|
||||
}
|
||||
|
||||
private Condition<? super Object> numberOf(int expected) {
|
||||
return new Condition<>(object -> object instanceof Number &&
|
||||
((Number) object).intValue() == expected, "Number %d", expected);
|
||||
return new Condition<>(object -> object instanceof Number num &&
|
||||
num.intValue() == expected, "Number %d", expected);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,12 +26,13 @@ import io.r2dbc.spi.ConnectionFactory;
|
||||
*/
|
||||
public class H2DatabaseClientIntegrationTests extends AbstractDatabaseClientIntegrationTests {
|
||||
|
||||
public static String CREATE_TABLE_LEGOSET = "CREATE TABLE legoset (\n" //
|
||||
+ " id serial CONSTRAINT id PRIMARY KEY,\n" //
|
||||
+ " version integer NULL,\n" //
|
||||
+ " name varchar(255) NOT NULL,\n" //
|
||||
+ " manual integer NULL\n" //
|
||||
+ ");";
|
||||
private static final String CREATE_TABLE_LEGOSET = """
|
||||
CREATE TABLE legoset (
|
||||
id serial CONSTRAINT id PRIMARY KEY,
|
||||
version integer NULL,
|
||||
name varchar(255) NOT NULL,
|
||||
manual integer NULL
|
||||
);""";
|
||||
|
||||
@Override
|
||||
protected ConnectionFactory createConnectionFactory() {
|
||||
|
||||
@@ -26,12 +26,13 @@ import io.r2dbc.spi.ConnectionFactory;
|
||||
*/
|
||||
public class H2TransactionalDatabaseClientIntegrationTests extends AbstractTransactionalDatabaseClientIntegrationTests {
|
||||
|
||||
public static String CREATE_TABLE_LEGOSET = "CREATE TABLE legoset (\n" //
|
||||
+ " id integer CONSTRAINT id PRIMARY KEY,\n" //
|
||||
+ " version integer NULL,\n" //
|
||||
+ " name varchar(255) NOT NULL,\n" //
|
||||
+ " manual integer NULL\n" //
|
||||
+ ");";
|
||||
private static final String CREATE_TABLE_LEGOSET = """
|
||||
CREATE TABLE legoset (
|
||||
id serial CONSTRAINT id PRIMARY KEY,
|
||||
version integer NULL,
|
||||
name varchar(255) NOT NULL,
|
||||
manual integer NULL
|
||||
);""";
|
||||
|
||||
@Override
|
||||
protected ConnectionFactory createConnectionFactory() {
|
||||
|
||||
Reference in New Issue
Block a user