-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42260 from xstefank/incorrect-data-in-ReactiveDat…
…asourceHealthCheck-42133 Fix a race condition in ReactiveDatasourceHealthCheck data field population
- Loading branch information
Showing
5 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...ment/src/test/java/io/quarkus/reactive/mssql/client/DataSourceHealthCheckPayloadTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.quarkus.reactive.mssql.client; | ||
|
||
import org.hamcrest.CoreMatchers; | ||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
public class DataSourceHealthCheckPayloadTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withEmptyApplication() | ||
.overrideConfigKey("quarkus.datasource.health.enabled", "true") | ||
.overrideConfigKey("quarkus.devservices.enabled", "false"); | ||
|
||
@Test | ||
public void testDataSourceHealthCheckPayload() { | ||
RestAssured.when().get("/q/health/ready") | ||
.then() | ||
.body("status", CoreMatchers.equalTo("DOWN")) | ||
.body("checks.data", CoreMatchers | ||
.hasItem(Matchers.hasValue(CoreMatchers.containsString("down - connection failed")))); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...ment/src/test/java/io/quarkus/reactive/mysql/client/DataSourceHealthCheckPayloadTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.quarkus.reactive.mysql.client; | ||
|
||
import org.hamcrest.CoreMatchers; | ||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
public class DataSourceHealthCheckPayloadTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withEmptyApplication() | ||
.overrideConfigKey("quarkus.datasource.health.enabled", "true") | ||
.overrideConfigKey("quarkus.devservices.enabled", "false"); | ||
|
||
@Test | ||
public void testDataSourceHealthCheckPayload() { | ||
RestAssured.when().get("/q/health/ready") | ||
.then() | ||
.body("status", CoreMatchers.equalTo("DOWN")) | ||
.body("checks.data", CoreMatchers | ||
.hasItem(Matchers.hasValue(CoreMatchers.containsString("down - connection failed")))); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...ent/src/test/java/io/quarkus/reactive/oracle/client/DataSourceHealthCheckPayloadTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.quarkus.reactive.oracle.client; | ||
|
||
import org.hamcrest.CoreMatchers; | ||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
public class DataSourceHealthCheckPayloadTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withEmptyApplication() | ||
.overrideConfigKey("quarkus.datasource.health.enabled", "true") | ||
.overrideConfigKey("quarkus.devservices.enabled", "false"); | ||
|
||
@Test | ||
public void testDataSourceHealthCheckPayload() { | ||
RestAssured.when().get("/q/health/ready") | ||
.then() | ||
.body("status", CoreMatchers.equalTo("DOWN")) | ||
.body("checks.data", CoreMatchers | ||
.hasItem(Matchers.hasValue(CoreMatchers.containsString("down - connection failed")))); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...loyment/src/test/java/io/quarkus/reactive/pg/client/DataSourceHealthCheckPayloadTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.quarkus.reactive.pg.client; | ||
|
||
import org.hamcrest.CoreMatchers; | ||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
public class DataSourceHealthCheckPayloadTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withEmptyApplication() | ||
.overrideConfigKey("quarkus.datasource.health.enabled", "true") | ||
.overrideConfigKey("quarkus.devservices.enabled", "false"); | ||
|
||
@Test | ||
public void testDataSourceHealthCheckPayload() { | ||
RestAssured.when().get("/q/health/ready") | ||
.then() | ||
.body("status", CoreMatchers.equalTo("DOWN")) | ||
.body("checks.data", CoreMatchers | ||
.hasItem(Matchers.hasValue(CoreMatchers.containsString("down - connection failed")))); | ||
} | ||
|
||
} |