Skip to content

Commit eb7cce4

Browse files
committed
Process review comments
1 parent f2510aa commit eb7cce4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/main/java/dasniko/testcontainers/keycloak/ExtendableKeycloakContainer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ protected void configure() {
166166
withEnv("KC_FEATURES_DISABLED", String.join(",", featuresDisabled));
167167
}
168168

169-
if(bootstrapAdmin) {
169+
if (bootstrapAdmin) {
170170
withEnv("KC_BOOTSTRAP_ADMIN_USERNAME", adminUsername);
171171
withEnv("KC_BOOTSTRAP_ADMIN_PASSWORD", adminPassword);
172172
}
@@ -521,7 +521,7 @@ private SELF withDebug(int hostPort, boolean suspend) {
521521
}
522522

523523
/** Disable default bootstrapping of the keycloak admin. Useful when realms are imported. */
524-
public SELF withoutBootstrapAdmin() {
524+
public SELF withBootstrapAdminDisabled() {
525525
this.bootstrapAdmin = false;
526526
return self();
527527
}

src/test/java/dasniko/testcontainers/keycloak/KeycloakContainerTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
public class KeycloakContainerTest {
3535

3636
public static final String TEST_REALM_JSON = "/test-realm.json";
37-
public static final String MASTER_REALM_USERS_JSON = "/master-realm.json";
37+
public static final String MASTER_REALM_WITH_ADMIN_USER_JSON = "/master-realm-with-admin-user.json";
3838

3939
@Test
4040
public void shouldStartKeycloak() {
@@ -52,7 +52,7 @@ public void shouldConsiderConfiguredStartupTimeout() {
5252
try (KeycloakContainer keycloak = new KeycloakContainer().withStartupTimeout(duration)) {
5353
keycloak.start();
5454
}
55-
} catch(ContainerLaunchException ex) {
55+
} catch (ContainerLaunchException ex) {
5656
Duration observedDuration = Duration.between(start, Instant.now());
5757
assertTrue(observedDuration.toSeconds() >= MAX_TIMEOUT && observedDuration.toSeconds() < 30,
5858
String.format("Startup time should consider configured limit of %d seconds, but took %d seconds",
@@ -97,8 +97,8 @@ public void shouldImportMultipleRealms() {
9797
@Test
9898
public void shouldImportMasterRealmAdmin() {
9999
try (KeycloakContainer keycloak = new KeycloakContainer()
100-
.withoutBootstrapAdmin()
101-
.withRealmImportFiles(MASTER_REALM_USERS_JSON)) {
100+
.withBootstrapAdminDisabled()
101+
.withRealmImportFiles(MASTER_REALM_WITH_ADMIN_USER_JSON)) {
102102
keycloak.start();
103103

104104
// Throws because we have imported a different admin user with different password

0 commit comments

Comments
 (0)