forked from keycloak/keycloak
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KEYCLOAK-13770 - Working DefaultThemeManagerTest
- Loading branch information
Showing
4 changed files
with
24 additions
and
6 deletions.
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
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
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
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 |
---|---|---|
|
@@ -6,19 +6,17 @@ | |
import org.keycloak.representations.idm.RealmRepresentation; | ||
import org.keycloak.testsuite.AbstractKeycloakTest; | ||
import org.keycloak.testsuite.arquillian.annotation.AuthServerContainerExclude; | ||
import org.keycloak.testsuite.util.ContainerAssume; | ||
import org.keycloak.theme.Theme; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
import static org.keycloak.testsuite.arquillian.annotation.AuthServerContainerExclude.AuthServer.QUARKUS; | ||
import static org.keycloak.testsuite.arquillian.annotation.AuthServerContainerExclude.AuthServer.REMOTE; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Vincent Letarouilly</a> | ||
*/ | ||
@AuthServerContainerExclude({REMOTE, QUARKUS}) | ||
@AuthServerContainerExclude({REMOTE}) | ||
public class DefaultThemeManagerTest extends AbstractKeycloakTest { | ||
|
||
private static final String THEME_NAME = "environment-agnostic"; | ||
|
@@ -38,11 +36,10 @@ public void addTestRealms(List<RealmRepresentation> testRealms) { | |
// KEYCLOAK-6698 | ||
@Test | ||
public void systemPropertiesSubstitutionInThemeProperties() { | ||
// TODO fix this test on auth-server-wildfly. There is an issue with setup of System properties (other JVM). | ||
ContainerAssume.assumeAuthServerUndertow(); | ||
testingClient.server().run(session -> { | ||
try { | ||
Theme theme = session.theme().getTheme(THEME_NAME, Theme.Type.LOGIN); | ||
Assert.assertEquals("getTheme(...) returns default theme when no matching theme found, but we need " + THEME_NAME + " theme deployed.",THEME_NAME, theme.getName()); | ||
Assert.assertEquals("Keycloak is awesome", theme.getProperties().getProperty("system.property.found")); | ||
Assert.assertEquals("${missing_system_property}", theme.getProperties().getProperty("system.property.missing")); | ||
Assert.assertEquals("defaultValue", theme.getProperties().getProperty("system.property.missing.with.default")); | ||
|
@@ -58,6 +55,7 @@ public void environmentVariablesSubstitutionInThemeProperties() { | |
testingClient.server().run(session -> { | ||
try { | ||
Theme theme = session.theme().getTheme(THEME_NAME, Theme.Type.LOGIN); | ||
Assert.assertEquals("getTheme(...) returns default theme when no matching theme found, but we need " + THEME_NAME + " theme deployed.",THEME_NAME, theme.getName()); | ||
Assert.assertEquals("${env.MISSING_ENVIRONMENT_VARIABLE}", theme.getProperties().getProperty("env.missing")); | ||
Assert.assertEquals("defaultValue", theme.getProperties().getProperty("env.missingWithDefault")); | ||
if (System.getenv().containsKey("HOMEPATH")) { | ||
|