Add IsIntegrationTest BuildStep Annotation
This commit is contained in:
parent
dad5639b4e
commit
c70dc0e72d
5 changed files with 24 additions and 14 deletions
|
@ -0,0 +1,19 @@
|
|||
package org.keycloak.quarkus.deployment;
|
||||
|
||||
import io.quarkus.deployment.IsTest;
|
||||
import io.quarkus.runtime.LaunchMode;
|
||||
|
||||
import static org.keycloak.quarkus.runtime.Environment.LAUNCH_MODE;
|
||||
|
||||
public class IsIntegrationTest extends IsTest {
|
||||
|
||||
public IsIntegrationTest(LaunchMode launchMode) {
|
||||
super(launchMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAsBoolean() {
|
||||
return super.getAsBoolean() && (System.getProperty(LAUNCH_MODE) != null && System.getProperty(LAUNCH_MODE).equals("test"));
|
||||
}
|
||||
|
||||
}
|
|
@ -20,7 +20,7 @@ package org.keycloak.quarkus.deployment;
|
|||
import java.util.function.BooleanSupplier;
|
||||
import org.keycloak.quarkus.runtime.Environment;
|
||||
|
||||
public class isReAugmentation implements BooleanSupplier {
|
||||
public class IsReAugmentation implements BooleanSupplier {
|
||||
|
||||
@Override
|
||||
public boolean getAsBoolean() {
|
|
@ -267,12 +267,12 @@ class KeycloakProcessor {
|
|||
*
|
||||
* @param configSources
|
||||
*/
|
||||
@BuildStep(onlyIf = IsNormal.class)
|
||||
@BuildStep(onlyIfNot = IsIntegrationTest.class )
|
||||
void configureConfigSources(BuildProducer<StaticInitConfigSourceProviderBuildItem> configSources) {
|
||||
configSources.produce(new StaticInitConfigSourceProviderBuildItem(KeycloakConfigSourceProvider.class.getName()));
|
||||
}
|
||||
|
||||
@BuildStep(onlyIf = IsTest.class)
|
||||
@BuildStep(onlyIf = IsIntegrationTest.class)
|
||||
void prepareTestEnvironment(BuildProducer<StaticInitConfigSourceProviderBuildItem> configSources) {
|
||||
configSources.produce(new StaticInitConfigSourceProviderBuildItem("org.keycloak.quarkus.runtime.configuration.test.TestKeycloakConfigSourceProvider"));
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ class KeycloakProcessor {
|
|||
* <p>Make the build time configuration available at runtime so that the server can run without having to specify some of
|
||||
* the properties again.
|
||||
*/
|
||||
@BuildStep(onlyIf = isReAugmentation.class)
|
||||
@BuildStep(onlyIf = IsReAugmentation.class)
|
||||
void persistBuildTimeProperties(BuildProducer<GeneratedResourceBuildItem> resources) {
|
||||
Properties properties = new Properties();
|
||||
|
||||
|
|
|
@ -52,13 +52,4 @@ public class KeycloakReadyHealthCheckTest {
|
|||
.statusCode(200)
|
||||
.body(Matchers.containsString("UP"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // Temporarily disabled. See KEYCLOAK-16382 and https://github.com/quarkusio/quarkus/issues/14705
|
||||
public void testMetricsUp() {
|
||||
given()
|
||||
.when().get("/metrics")
|
||||
.then()
|
||||
.statusCode(200);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,4 +46,4 @@ public class TestKeycloakConfigSourceProvider extends KeycloakConfigSourceProvid
|
|||
}
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue