-
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.
Issue 10343: Disabled default quarkus-oidc tenant blocks access to th…
…e public resources
- Loading branch information
Showing
3 changed files
with
59 additions
and
2 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
46 changes: 46 additions & 0 deletions
46
...s/oidc/runtime/src/test/java/io/quarkus/oidc/runtime/OidcAuthenticationMechanismTest.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,46 @@ | ||
package io.quarkus.oidc.runtime; | ||
|
||
import static org.mockito.Mockito.verifyNoInteractions; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.MockitoAnnotations; | ||
|
||
import io.quarkus.security.identity.IdentityProviderManager; | ||
import io.vertx.ext.web.RoutingContext; | ||
|
||
public class OidcAuthenticationMechanismTest { | ||
|
||
@Mock | ||
private DefaultTenantConfigResolver resolver; | ||
|
||
@Mock | ||
private RoutingContext context; | ||
|
||
@Mock | ||
private IdentityProviderManager identityProviderManager; | ||
|
||
@InjectMocks | ||
private OidcAuthenticationMechanism mechanism = new OidcAuthenticationMechanism(); | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
MockitoAnnotations.initMocks(this); | ||
} | ||
|
||
@Test | ||
public void shouldNotCheckWebAppInSync() { | ||
whenAuthenticate(); | ||
thenResolverIsNotCalled(); | ||
} | ||
|
||
private void whenAuthenticate() { | ||
mechanism.authenticate(context, identityProviderManager); | ||
} | ||
|
||
private void thenResolverIsNotCalled() { | ||
verifyNoInteractions(resolver); | ||
} | ||
} |