-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(oidc): Dont start KC Dev Svc when known provider configured
- Loading branch information
1 parent
18110f8
commit 89c7131
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