Search in sources :

Example 36 with CLIResult

use of org.keycloak.it.junit5.extension.CLIResult in project keycloak by keycloak.

the class FeaturesDistTest method testEnableMultipleFeatures.

@Test
@Launch({ StartDev.NAME, "--features=token-exchange,admin-fine-grained-authz" })
public void testEnableMultipleFeatures(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    cliResult.assertStartedDevMode();
    assertThat(cliResult.getOutput(), CoreMatchers.allOf(containsString("Preview feature enabled: admin_fine_grained_authz"), containsString("Preview feature enabled: token_exchange")));
    assertFalse(cliResult.getOutput().contains("declarative-user-profile"));
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Test(org.junit.jupiter.api.Test) Launch(io.quarkus.test.junit.main.Launch)

Example 37 with CLIResult

use of org.keycloak.it.junit5.extension.CLIResult in project keycloak by keycloak.

the class StartDevCommandTest method testDevModeWarning.

@Test
@Launch({ "start-dev" })
void testDevModeWarning(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    cliResult.assertStartedDevMode();
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) Test(org.junit.jupiter.api.Test) CLITest(org.keycloak.it.junit5.extension.CLITest) Launch(io.quarkus.test.junit.main.Launch)

Example 38 with CLIResult

use of org.keycloak.it.junit5.extension.CLIResult in project keycloak by keycloak.

the class BuildCommandDistTest method testFailRuntimeOptions.

@Test
@Launch({ "build", "--db=postgres", "--db-username=myuser", "--db-password=mypassword", "--http-enabled=true" })
void testFailRuntimeOptions(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    cliResult.assertError("Unknown options: '--db-username=myuser', '--db-password=mypassword', '--http-enabled=true'");
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) Test(org.junit.jupiter.api.Test) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Launch(io.quarkus.test.junit.main.Launch)

Example 39 with CLIResult

use of org.keycloak.it.junit5.extension.CLIResult in project keycloak by keycloak.

the class ExportDistTest method testExport.

@Test
@Launch({ "export", "--realm=master", "--dir=." })
void testExport(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    cliResult.assertMessage("Export of realm 'master' requested.");
    cliResult.assertMessage("Export finished successfully");
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) Test(org.junit.jupiter.api.Test) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Launch(io.quarkus.test.junit.main.Launch)

Example 40 with CLIResult

use of org.keycloak.it.junit5.extension.CLIResult in project keycloak by keycloak.

the class LoggingDistTest method testSetRootLevel.

@Test
@Launch({ "start-dev", "--log-level=debug" })
void testSetRootLevel(LaunchResult result) {
    CLIResult cliResult = (CLIResult) result;
    assertTrue(cliResult.getOutput().contains("DEBUG [org.hibernate"));
    cliResult.assertStartedDevMode();
}
Also used : CLIResult(org.keycloak.it.junit5.extension.CLIResult) Test(org.junit.jupiter.api.Test) DistributionTest(org.keycloak.it.junit5.extension.DistributionTest) Launch(io.quarkus.test.junit.main.Launch)

Aggregations

Launch (io.quarkus.test.junit.main.Launch)56 Test (org.junit.jupiter.api.Test)56 CLIResult (org.keycloak.it.junit5.extension.CLIResult)56 DistributionTest (org.keycloak.it.junit5.extension.DistributionTest)41 Order (org.junit.jupiter.api.Order)23 TestMethodOrder (org.junit.jupiter.api.TestMethodOrder)23 CLITest (org.keycloak.it.junit5.extension.CLITest)12 BeforeStartDistribution (org.keycloak.it.junit5.extension.BeforeStartDistribution)4 StartCommandTest (org.keycloak.it.cli.StartCommandTest)1