forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#44980 from michalvavrik/feature/dont-sta…
…rt-kc-dev-svc-when-oidc-fine Don't start Keycloak Dev Service for OIDC client and other extensions when OIDC extension is configured with a known social provider
- Loading branch information
Showing
5 changed files
with
52 additions
and
16 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
33 changes: 33 additions & 0 deletions
33
...loyment/src/test/java/io/quarkus/oidc/client/OidcClientKeycloakDevServiceStartupTest.java
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.quarkus.oidc.client; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.jboss.shrinkwrap.api.asset.StringAsset; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
/** | ||
* Test Keycloak Dev Service is not started when known social provider is configured | ||
* in Quarkus OIDC extension. | ||
*/ | ||
public class OidcClientKeycloakDevServiceStartupTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest test = new QuarkusUnitTest() | ||
.withApplicationRoot(jar -> jar | ||
.addAsResource(new StringAsset(""" | ||
quarkus.oidc.provider=slack | ||
quarkus.oidc.client-id=irrelevant-client-id | ||
"""), "application.properties")) | ||
.setLogRecordPredicate(logRecord -> logRecord != null && logRecord.getMessage() != null | ||
&& logRecord.getMessage().contains("Dev Services for Keycloak started")) | ||
.assertLogRecords(logRecords -> assertTrue(logRecords.isEmpty())); | ||
|
||
@Test | ||
public void testDevServiceNotStarted() { | ||
// needs to be here so that log asserter runs after all tests | ||
} | ||
|
||
} |
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