Search in sources :

Example 16 with Launch

use of io.quarkus.test.junit.main.Launch in project keycloak by keycloak.

the class StartAutoBuildDistTest method testStartAutoBuild.

@Test
@Launch({ "start", "--auto-build", "--http-enabled=true", "--hostname-strict=false", "--cache=local" })
@Order(1)
void testStartAutoBuild(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    cliResult.assertMessage("Changes detected in configuration. Updating the server image.");
    cliResult.assertMessage("Updating the configuration and installing your custom providers, if any. Please wait.");
    cliResult.assertMessage("Server configuration updated and persisted. Run the following command to review the configuration:");
    cliResult.assertMessage(KeycloakDistribution.SCRIPT_CMD + " show-config");
    cliResult.assertMessage("Next time you run the server, just run:");
    cliResult.assertMessage(KeycloakDistribution.SCRIPT_CMD + " start --http-enabled=true --hostname-strict=false");
    assertFalse(cliResult.getOutput().contains("--cache"));
    cliResult.assertStarted();
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Launch(io.quarkus.test.junit.main.Launch)

Example 17 with Launch

use of io.quarkus.test.junit.main.Launch in project keycloak by keycloak.

the class StartAutoBuildDistTest method testShouldNotReAugIfSameDatabase.

@Test
@Launch({ "start", "--auto-build", "--db=dev-mem", "--http-enabled=true", "--hostname-strict=false", "--cache=local" })
@Order(4)
void testShouldNotReAugIfSameDatabase(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    cliResult.assertNoBuild();
    cliResult.assertStarted();
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Launch(io.quarkus.test.junit.main.Launch)

Example 18 with Launch

use of io.quarkus.test.junit.main.Launch in project keycloak by keycloak.

the class StartAutoBuildDistTest method testReAugWhenNoOptionAfterBuild.

@Test
@Launch({ "start", "--auto-build", "--http-enabled=true", "--hostname-strict=false", "--cache=local" })
@Order(6)
void testReAugWhenNoOptionAfterBuild(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    cliResult.assertBuild();
    cliResult.assertStarted();
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Launch(io.quarkus.test.junit.main.Launch)

Example 19 with Launch

use of io.quarkus.test.junit.main.Launch in project keycloak by keycloak.

the class BasicDatabaseTest method testImportSucceeds.

@Order(2)
@Test
@Launch({ "import", "--dir=./target/export" })
void testImportSucceeds(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    cliResult.assertMessage("target/export");
    cliResult.assertMessage("Realm 'master' imported");
    cliResult.assertMessage("Import finished successfully");
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test) Launch(io.quarkus.test.junit.main.Launch)

Example 20 with Launch

use of io.quarkus.test.junit.main.Launch in project keycloak by keycloak.

the class BasicDatabaseTest method testWrongUsername.

@Test
@Launch({ "start", "--http-enabled=true", "--hostname-strict=false", "--db-username=wrong" })
void testWrongUsername(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    cliResult.assertMessage("ERROR: Failed to obtain JDBC connection");
    assertWrongUsername(cliResult);
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) Test(org.junit.jupiter.api.Test) Launch(io.quarkus.test.junit.main.Launch)

Aggregations

Launch (io.quarkus.test.junit.main.Launch)102 Test (org.junit.jupiter.api.Test)101 CLIResult (org.keycloak.it.junit5.extension.CLIResult)98 DistributionTest (org.keycloak.it.junit5.extension.DistributionTest)70 Order (org.junit.jupiter.api.Order)37 TestMethodOrder (org.junit.jupiter.api.TestMethodOrder)37 CLITest (org.keycloak.it.junit5.extension.CLITest)23 BeforeStartDistribution (org.keycloak.it.junit5.extension.BeforeStartDistribution)19 EnabledOnOs (org.junit.jupiter.api.condition.EnabledOnOs)14 File (java.io.File)3 Path (java.nio.file.Path)3 RawDistRootPath (org.keycloak.it.utils.RawDistRootPath)3 StartCommandTest (org.keycloak.it.cli.StartCommandTest)2 Pattern (java.util.regex.Pattern)1 KeepServerAlive (org.keycloak.it.junit5.extension.KeepServerAlive)1 PostgreSQLTest (org.keycloak.it.storage.database.PostgreSQLTest)1