-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add system variable to menuitem url * fix: add system variable to menuitem url * fix: add system variable to menuitem url * fix: add tests to url system env * fix: remove logs adjust UserMenuMapper * fix: formatter * fix: docs added * feat: add homePage to WorkspaceWrapper external * feat: add disabled to Export import * feat: add interpolate test userMenu url * fix: format * fix: docs --------- Co-authored-by: Andrej Petras <[email protected]>
- Loading branch information
1 parent
16433d0
commit bc1721b
Showing
12 changed files
with
106 additions
and
48 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
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
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
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
48 changes: 48 additions & 0 deletions
48
...g/tkit/onecx/workspace/rs/user/controllers/UserMenuInternalControllerInterpolateTest.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,48 @@ | ||
package org.tkit.onecx.workspace.rs.user.controllers; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; | ||
import static jakarta.ws.rs.core.Response.Status.OK; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.tkit.quarkus.security.test.SecurityTestUtils.getKeycloakClientToken; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.tkit.onecx.workspace.test.AbstractTest; | ||
import org.tkit.quarkus.security.test.GenerateKeycloakClient; | ||
import org.tkit.quarkus.test.WithDBData; | ||
|
||
import gen.org.tkit.onecx.workspace.rs.user.model.UserWorkspaceMenuRequestDTO; | ||
import gen.org.tkit.onecx.workspace.rs.user.model.UserWorkspaceMenuStructureDTO; | ||
import io.quarkus.test.common.http.TestHTTPEndpoint; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
@QuarkusTest | ||
@TestHTTPEndpoint(UserMenuInternalController.class) | ||
@WithDBData(value = "data/testdata-user.xml", deleteBeforeInsert = true, deleteAfterTest = true, rinseAndRepeat = true) | ||
@GenerateKeycloakClient(clientName = "testClient", scopes = { "ocx-ws:all", "ocx-ws:read", "ocx-ws:write" }) | ||
public class UserMenuInternalControllerInterpolateTest extends AbstractTest { | ||
|
||
@Test | ||
void getMenuStructure_shouldReturnSystemURL() { | ||
|
||
var workspaceName = "test03"; | ||
var accessToken = createAccessTokenBearer(USER_BOB); | ||
var idToken = createToken("org1"); | ||
|
||
var data = given() | ||
.auth().oauth2(getKeycloakClientToken("testClient")) | ||
.when() | ||
.contentType(APPLICATION_JSON) | ||
.header(APM_HEADER_PARAM, idToken) | ||
.body(new UserWorkspaceMenuRequestDTO().token(accessToken)) | ||
.pathParam("workspaceName", workspaceName) | ||
.post() | ||
.then() | ||
.statusCode(OK.getStatusCode()) | ||
.extract().body().as(UserWorkspaceMenuStructureDTO.class); | ||
|
||
assertThat(data).isNotNull(); | ||
assertThat(data.getMenu().get(1).getChildren().get(0).getUrl()).isEqualTo("/company3/testItem1"); | ||
} | ||
|
||
} |
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