Adjust IDENTITY in DDLs for H2 2.x compatibility

See gh-29200
This commit is contained in:
Henning Poettker
2022-01-08 13:59:58 +01:00
committed by Stephane Nicoll
parent 37c1f47902
commit e3d0f1feee
12 changed files with 22 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -98,9 +98,11 @@ class ConnectionFactoryHealthIndicatorTests {
CloseableConnectionFactory connectionFactory = createTestDatabase();
try {
String customValidationQuery = "SELECT COUNT(*) from HEALTH_TEST";
Mono.from(connectionFactory.create()).flatMapMany((it) -> Flux
.from(it.createStatement("CREATE TABLE HEALTH_TEST (id INTEGER IDENTITY PRIMARY KEY)").execute())
.flatMap(Result::getRowsUpdated).thenMany(it.close())).as(StepVerifier::create).verifyComplete();
String createTableStatement = "CREATE TABLE HEALTH_TEST (id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY)";
Mono.from(connectionFactory.create())
.flatMapMany((it) -> Flux.from(it.createStatement(createTableStatement).execute())
.flatMap(Result::getRowsUpdated).thenMany(it.close()))
.as(StepVerifier::create).verifyComplete();
ReactiveHealthIndicator healthIndicator = new ConnectionFactoryHealthIndicator(connectionFactory,
customValidationQuery);
healthIndicator.health().as(StepVerifier::create).assertNext((actual) -> {