mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
[Windows] Stabilizing flaky Quarkus unit tests (#35638)
[Windows] Stabilizing flaky Quarkus unit tests Closes: #35405 Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
This commit is contained in:
parent
d3b759b56f
commit
0e1a62fa60
@ -20,7 +20,9 @@ import io.quarkus.test.QuarkusUnitTest;
|
||||
import io.restassured.RestAssured;
|
||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||
import org.jboss.shrinkwrap.api.spec.JavaArchive;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
@ -28,8 +30,18 @@ import static io.restassured.RestAssured.given;
|
||||
|
||||
class KeycloakMetricsConfigurationTest {
|
||||
|
||||
@BeforeAll
|
||||
static void setUpAll() {
|
||||
System.setProperty("KC_CACHE", "local");
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
static void tearDownAll() {
|
||||
System.clearProperty("KC_CACHE");
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void setUpPort() {
|
||||
void setUp() {
|
||||
RestAssured.port = 9001;
|
||||
}
|
||||
|
||||
|
||||
@ -45,10 +45,12 @@ public class KeycloakNegativeHealthCheckTest {
|
||||
agroalDataSource.close();
|
||||
|
||||
RestAssured.port = 9001;
|
||||
System.setProperty("KC_CACHE", "local"); // avoid flaky port conflicts
|
||||
given()
|
||||
.when().get("/health/ready")
|
||||
.then()
|
||||
.statusCode(503)
|
||||
.body(Matchers.containsString("DOWN"));
|
||||
System.clearProperty("KC_CACHE");
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,6 +20,8 @@ import io.quarkus.test.QuarkusUnitTest;
|
||||
import io.restassured.RestAssured;
|
||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||
import org.jboss.shrinkwrap.api.spec.JavaArchive;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
@ -29,8 +31,18 @@ import static org.hamcrest.CoreMatchers.is;
|
||||
|
||||
class KeycloakPathConfigurationTest {
|
||||
|
||||
@BeforeAll
|
||||
static void setUpAll() {
|
||||
System.setProperty("KC_CACHE", "local");
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
static void tearDownAll() {
|
||||
System.clearProperty("KC_CACHE");
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void setUpPort() {
|
||||
void setUp() {
|
||||
RestAssured.port = 9001;
|
||||
}
|
||||
|
||||
|
||||
@ -21,6 +21,8 @@ import io.restassured.RestAssured;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||
import org.jboss.shrinkwrap.api.spec.JavaArchive;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
@ -29,8 +31,18 @@ import static io.restassured.RestAssured.given;
|
||||
|
||||
public class KeycloakReadyHealthCheckTest {
|
||||
|
||||
@BeforeAll
|
||||
static void setUpAll() {
|
||||
System.setProperty("KC_CACHE", "local");
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
static void tearDownAll() {
|
||||
System.clearProperty("KC_CACHE");
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void setUpPort() {
|
||||
void setUp() {
|
||||
RestAssured.port = 9001;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user