-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
879d1e3
commit 64f4f43
Showing
5 changed files
with
91 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
45 changes: 45 additions & 0 deletions
45
...a/io/github/onecx/permission/rs/external/v1/PermissionRestControllerConfigIssuerTest.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,45 @@ | ||
package io.github.onecx.permission.rs.external.v1; | ||
|
||
import io.github.onecx.permission.test.AbstractTest; | ||
|
||
//@QuarkusTest | ||
//@TestHTTPEndpoint(PermissionRestController.class) | ||
//@WithDBData(value = "data/test-v1.xml", deleteBeforeInsert = true, deleteAfterTest = true, rinseAndRepeat = true) | ||
public class PermissionRestControllerConfigIssuerTest extends AbstractTest { | ||
// | ||
// @InjectMock | ||
// TokenConfig tokenConfig; | ||
// | ||
// @Inject | ||
// Config config; | ||
// | ||
// @BeforeEach | ||
// void beforeEach() { | ||
// var tmp = config.unwrap(SmallRyeConfig.class).getConfigMapping(TokenConfig.class); | ||
// Mockito.when(tokenConfig.tokenClaimSeparator()).thenReturn(tmp.tokenClaimSeparator()); | ||
// Mockito.when(tokenConfig.tokenClaimPath()).thenReturn("groups"); | ||
// Mockito.when(tokenConfig.tokenVerified()).thenReturn(true); | ||
// Mockito.when(tokenConfig.tokenPublicKeyLocationSuffix()).thenReturn(tmp.tokenPublicKeyLocationSuffix()); | ||
// Mockito.when(tokenConfig.tokenPublicKeyEnabled()).thenReturn(true); | ||
// } | ||
// | ||
// @Test | ||
// void skipTokenVerified() { | ||
// | ||
// KeycloakTestClient keycloakClient = new KeycloakTestClient(); | ||
// var accessToken = keycloakClient.getAccessToken("bob"); | ||
// | ||
// var dto = given() | ||
// .contentType(APPLICATION_JSON) | ||
// .body(new PermissionRequestDTOV1().token(accessToken)) | ||
// .post("/application/app1") | ||
// .then() | ||
// .statusCode(OK.getStatusCode()) | ||
// .extract() | ||
// .body().as(ApplicationPermissionsDTOV1.class); | ||
// | ||
// assertThat(dto).isNotNull(); | ||
// assertThat(dto.getPermissions()).isNotNull().hasSize(1); | ||
// assertThat(dto.getPermissions().get("o1")).isNotNull().hasSize(1).containsExactly("a3"); | ||
// } | ||
} |
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