Skip to content

Commit c089494

Browse files
test: remove hub tests temporarily (box/box-codegen#812) (#1391)
* test: ExternalUsers API integration tests (box/box-codegen#799) * chore: Update `.codegen.json` with commit hash of `codegen` and `openapi` spec [skip ci] * chore: Update `.codegen.json` with commit hash of `codegen` and `openapi` spec [skip ci] * chore: Update `.codegen.json` with commit hash of `codegen` and `openapi` spec [skip ci] * test: remove hub tests temporarily (box/box-codegen#812)
1 parent f675d3e commit c089494

File tree

8 files changed

+60
-294
lines changed

8 files changed

+60
-294
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "3ba449c", "specHash": "ec8720b", "version": "0.1.0" }
1+
{ "engineHash": "dd00f3f", "specHash": "ec8720b", "version": "0.1.0" }

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
ENTERPRISE_ID: ${{ secrets.ENTERPRISE_ID }}
3535
BOX_FILE_REQUEST_ID: ${{ secrets.BOX_FILE_REQUEST_ID }}
3636
BOX_EXTERNAL_USER_EMAIL: ${{ secrets.BOX_EXTERNAL_USER_EMAIL }}
37+
BOX_EXTERNAL_USER_ID: ${{ secrets.BOX_EXTERNAL_USER_ID }}
3738
APP_ITEM_ASSOCIATION_FILE_ID: ${{ secrets.APP_ITEM_ASSOCIATION_FILE_ID }}
3839
APP_ITEM_ASSOCIATION_FOLDER_ID: ${{ secrets.APP_ITEM_ASSOCIATION_FOLDER_ID }}
3940
WORKFLOW_FOLDER_ID: ${{ secrets.WORKFLOW_FOLDER_ID }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Now select `Authorization` and submit application to be reviewed by account admi
113113
download your app configuration settings as JSON.
114114
2. Encode configuration file to Base64, e.g. using command: `base64 -i path_to_json_file`
115115
3. Set environment variable: `JWT_CONFIG_BASE_64` with base64 encoded jwt configuration file
116-
4. Set environment variable: `BOX_FILE_REQUEST_ID` with ID of file request already created in the user account, `BOX_EXTERNAL_USER_EMAIL` with email of free external user which not belongs to any enterprise.
116+
4. Set environment variable: `BOX_FILE_REQUEST_ID` with ID of file request already created in the user account, `BOX_EXTERNAL_USER_EMAIL` with email of free external user which not belongs to any enterprise and `BOX_EXTERNAL_USER_ID` with its ID.
117117
5. Set environment variable: `WORKFLOW_FOLDER_ID` with the ID of the Relay workflow that deletes the file that triggered the workflow. The workflow should have a manual start to be able to start it from the API.
118118
6. Set environment variable: `APP_ITEM_ASSOCIATION_FILE_ID` to the ID of the file with associated app item and `APP_ITEM_ASSOCIATION_FOLDER_ID` to the ID of the folder with associated app item.
119119
7. Set environment variable: `APP_ITEM_SHARED_LINK` to the shared link associated with app item.

docs/externalusers.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ This operation is performed by calling function `submitJobToDeleteExternalUsersV
1313
See the endpoint docs at
1414
[API Reference](https://developer.box.com/reference/v2025.0/post-external-users-submit-delete-job/).
1515

16-
*Currently we don't have an example for calling `submitJobToDeleteExternalUsersV2025R0` in integration tests*
16+
<!-- sample post_external_users_submit_delete_job_v2025.0 -->
17+
```
18+
client.getExternalUsers().submitJobToDeleteExternalUsersV2025R0(new ExternalUsersSubmitDeleteJobRequestV2025R0(Arrays.asList(new UserReferenceV2025R0(getEnvVar("BOX_EXTERNAL_USER_ID")))))
19+
```
1720

1821
### Arguments
1922

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.box.sdkgen.test.externalusers;
2+
3+
import static com.box.sdkgen.internal.utils.UtilsManager.getEnvVar;
4+
import static com.box.sdkgen.test.commons.CommonsManager.getDefaultClientWithUserSubject;
5+
import static com.box.sdkgen.test.commons.CommonsManager.uploadNewFile;
6+
7+
import com.box.sdkgen.client.BoxClient;
8+
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBody;
9+
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBodyAccessibleByField;
10+
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBodyAccessibleByTypeField;
11+
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBodyItemField;
12+
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBodyItemTypeField;
13+
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBodyRoleField;
14+
import com.box.sdkgen.schemas.collaboration.Collaboration;
15+
import com.box.sdkgen.schemas.filefull.FileFull;
16+
import com.box.sdkgen.schemas.v2025r0.externaluserssubmitdeletejobrequestv2025r0.ExternalUsersSubmitDeleteJobRequestV2025R0;
17+
import com.box.sdkgen.schemas.v2025r0.externaluserssubmitdeletejobresponsev2025r0.ExternalUsersSubmitDeleteJobResponseV2025R0;
18+
import com.box.sdkgen.schemas.v2025r0.userreferencev2025r0.UserReferenceV2025R0;
19+
import java.util.Arrays;
20+
import org.junit.jupiter.api.Test;
21+
22+
public class ExternalUsersITest {
23+
24+
private static final BoxClient client = getDefaultClientWithUserSubject(getEnvVar("USER_ID"));
25+
26+
@Test
27+
public void testSubmitJobToDeleteExternalUsers() {
28+
FileFull file = uploadNewFile();
29+
Collaboration fileCollaboration =
30+
client
31+
.getUserCollaborations()
32+
.createCollaboration(
33+
new CreateCollaborationRequestBody(
34+
new CreateCollaborationRequestBodyItemField.Builder()
35+
.type(CreateCollaborationRequestBodyItemTypeField.FILE)
36+
.id(file.getId())
37+
.build(),
38+
new CreateCollaborationRequestBodyAccessibleByField.Builder(
39+
CreateCollaborationRequestBodyAccessibleByTypeField.USER)
40+
.id(getEnvVar("BOX_EXTERNAL_USER_ID"))
41+
.build(),
42+
CreateCollaborationRequestBodyRoleField.EDITOR));
43+
ExternalUsersSubmitDeleteJobResponseV2025R0 externalUsersJobDeleteResponse =
44+
client
45+
.getExternalUsers()
46+
.submitJobToDeleteExternalUsersV2025R0(
47+
new ExternalUsersSubmitDeleteJobRequestV2025R0(
48+
Arrays.asList(new UserReferenceV2025R0(getEnvVar("BOX_EXTERNAL_USER_ID")))));
49+
assert externalUsersJobDeleteResponse.getEntries().size() == 1;
50+
assert externalUsersJobDeleteResponse.getEntries().get(0).getStatus() == 202;
51+
client.getFiles().deleteFileById(file.getId());
52+
}
53+
}

src/test/java/com/box/sdkgen/test/hubcollaborations/HubCollaborationsITest.java

Lines changed: 0 additions & 94 deletions
This file was deleted.

src/test/java/com/box/sdkgen/test/hubitems/HubItemsITest.java

Lines changed: 0 additions & 92 deletions
This file was deleted.

src/test/java/com/box/sdkgen/test/hubs/HubsITest.java

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)