BAEL-18211 Fix the integrations tests in spring-5-data-reactive
- Several fixes to fix the project setup in case of multiple spring data reactive repositories and fix assertion failures
This commit is contained in:
@@ -8,7 +8,7 @@ import org.springframework.data.r2dbc.config.AbstractR2dbcConfiguration;
|
|||||||
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories;
|
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
//@EnableR2dbcRepositories(basePackages = "com.baeldung.r2dbc.repository")
|
@EnableR2dbcRepositories(basePackages = "com.baeldung.r2dbc.repository")
|
||||||
public class R2DBCConfiguration extends AbstractR2dbcConfiguration {
|
public class R2DBCConfiguration extends AbstractR2dbcConfiguration {
|
||||||
@Bean
|
@Bean
|
||||||
public H2ConnectionFactory connectionFactory() {
|
public H2ConnectionFactory connectionFactory() {
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.springframework.data.annotation.Id;
|
import org.springframework.data.annotation.Id;
|
||||||
|
import org.springframework.data.relational.core.mapping.Table;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@Table
|
||||||
public class Player {
|
public class Player {
|
||||||
@Id
|
@Id
|
||||||
Integer id;
|
Integer id;
|
||||||
|
|||||||
@@ -111,12 +111,12 @@ public class R2dbcApplicationIntegrationTest {
|
|||||||
|
|
||||||
private void insertPlayers() {
|
private void insertPlayers() {
|
||||||
List<Player> players = Arrays.asList(
|
List<Player> players = Arrays.asList(
|
||||||
new Player(1, "Kaka", 37),
|
new Player(null, "Kaka", 37),
|
||||||
new Player(2, "Messi", 32),
|
new Player(null, "Messi", 32),
|
||||||
new Player(3, "Mbappé", 20),
|
new Player(null, "Mbappé", 20),
|
||||||
new Player(4, "CR7", 34),
|
new Player(null, "CR7", 34),
|
||||||
new Player(5, "Lewandowski", 30),
|
new Player(null, "Lewandowski", 30),
|
||||||
new Player(6, "Cavani", 32)
|
new Player(null, "Cavani", 32)
|
||||||
);
|
);
|
||||||
|
|
||||||
playerRepository.saveAll(players).subscribe();
|
playerRepository.saveAll(players).subscribe();
|
||||||
|
|||||||
Reference in New Issue
Block a user