|
|
|
@ -25,6 +25,7 @@ import reactor.test.StepVerifier; |
|
|
|
|
|
|
|
|
|
|
|
import javax.sql.DataSource; |
|
|
|
import javax.sql.DataSource; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.assertj.core.api.Condition; |
|
|
|
import org.junit.Before; |
|
|
|
import org.junit.Before; |
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
|
|
@ -110,7 +111,7 @@ public abstract class AbstractDatabaseClientIntegrationTests extends R2dbcIntegr |
|
|
|
.expectNext(1) //
|
|
|
|
.expectNext(1) //
|
|
|
|
.verifyComplete(); |
|
|
|
.verifyComplete(); |
|
|
|
|
|
|
|
|
|
|
|
assertThat(jdbc.queryForMap("SELECT id, name, manual FROM legoset")).containsEntry("id", 42055); |
|
|
|
assertThat(jdbc.queryForMap("SELECT id, name, manual FROM legoset")).hasEntrySatisfying("id", numberOf(42055)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test // gh-2
|
|
|
|
@Test // gh-2
|
|
|
|
@ -121,9 +122,9 @@ public abstract class AbstractDatabaseClientIntegrationTests extends R2dbcIntegr |
|
|
|
executeInsert(); |
|
|
|
executeInsert(); |
|
|
|
|
|
|
|
|
|
|
|
databaseClient.execute(getInsertIntoLegosetStatement()) //
|
|
|
|
databaseClient.execute(getInsertIntoLegosetStatement()) //
|
|
|
|
.bind(0, 42055) //
|
|
|
|
.bind("id", 42055) //
|
|
|
|
.bind(1, "SCHAUFELRADBAGGER") //
|
|
|
|
.bind("name", "SCHAUFELRADBAGGER") //
|
|
|
|
.bindNull(2, Integer.class) //
|
|
|
|
.bindNull("manual", Integer.class) //
|
|
|
|
.fetch().rowsUpdated() //
|
|
|
|
.fetch().rowsUpdated() //
|
|
|
|
.as(StepVerifier::create) //
|
|
|
|
.as(StepVerifier::create) //
|
|
|
|
.expectErrorSatisfies(exception -> assertThat(exception) //
|
|
|
|
.expectErrorSatisfies(exception -> assertThat(exception) //
|
|
|
|
@ -166,7 +167,7 @@ public abstract class AbstractDatabaseClientIntegrationTests extends R2dbcIntegr |
|
|
|
.expectNext(1) //
|
|
|
|
.expectNext(1) //
|
|
|
|
.verifyComplete(); |
|
|
|
.verifyComplete(); |
|
|
|
|
|
|
|
|
|
|
|
assertThat(jdbc.queryForMap("SELECT id, name, manual FROM legoset")).containsEntry("id", 42055); |
|
|
|
assertThat(jdbc.queryForMap("SELECT id, name, manual FROM legoset")).hasEntrySatisfying("id", numberOf(42055)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test // gh-2
|
|
|
|
@Test // gh-2
|
|
|
|
@ -182,7 +183,7 @@ public abstract class AbstractDatabaseClientIntegrationTests extends R2dbcIntegr |
|
|
|
.as(StepVerifier::create) //
|
|
|
|
.as(StepVerifier::create) //
|
|
|
|
.verifyComplete(); |
|
|
|
.verifyComplete(); |
|
|
|
|
|
|
|
|
|
|
|
assertThat(jdbc.queryForMap("SELECT id, name, manual FROM legoset")).containsEntry("id", 42055); |
|
|
|
assertThat(jdbc.queryForMap("SELECT id, name, manual FROM legoset")).hasEntrySatisfying("id", numberOf(42055)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test // gh-2
|
|
|
|
@Test // gh-2
|
|
|
|
@ -203,7 +204,7 @@ public abstract class AbstractDatabaseClientIntegrationTests extends R2dbcIntegr |
|
|
|
.expectNext(1) //
|
|
|
|
.expectNext(1) //
|
|
|
|
.verifyComplete(); |
|
|
|
.verifyComplete(); |
|
|
|
|
|
|
|
|
|
|
|
assertThat(jdbc.queryForMap("SELECT id, name, manual FROM legoset")).containsEntry("id", 42055); |
|
|
|
assertThat(jdbc.queryForMap("SELECT id, name, manual FROM legoset")).hasEntrySatisfying("id", numberOf(42055)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test // gh-64
|
|
|
|
@Test // gh-64
|
|
|
|
@ -456,6 +457,12 @@ public abstract class AbstractDatabaseClientIntegrationTests extends R2dbcIntegr |
|
|
|
.verifyComplete(); |
|
|
|
.verifyComplete(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Condition<? super Object> numberOf(int expected) { |
|
|
|
|
|
|
|
return new Condition<>(it -> { |
|
|
|
|
|
|
|
return it instanceof Number && ((Number) it).intValue() == expected; |
|
|
|
|
|
|
|
}, "Number %d", expected); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Data |
|
|
|
@Data |
|
|
|
@Table("legoset") |
|
|
|
@Table("legoset") |
|
|
|
static class LegoSet { |
|
|
|
static class LegoSet { |
|
|
|
|