From 96c272bf5275e5e039395c2bd70e5f387e5bfe97 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Wed, 25 Nov 2026 10:43:08 -0800 Subject: [PATCH] test(SDK-7096): add aiSessions ITests (box/box-codegen#1014) --- .codegen.json | 2 +- docs/sdkgen/aisessions.md | 10 +++++-- .../sdkgen/aisessions/AiSessionsITest.java | 30 +++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/intTest/java/com/box/sdkgen/aisessions/AiSessionsITest.java diff --git a/.codegen.json b/.codegen.json index 484bc572f..6c1cb8a4f 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "195d3d1", "specHash": "58bd93b", "version": "5.21.0" } +{ "engineHash": "6ad8251", "specHash": "58bd93b", "version": "5.21.0" } diff --git a/docs/sdkgen/aisessions.md b/docs/sdkgen/aisessions.md index a288f080b..df2c8184e 100644 --- a/docs/sdkgen/aisessions.md +++ b/docs/sdkgen/aisessions.md @@ -22,7 +22,10 @@ This operation is performed by calling function `getAiSessionsV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-ai-sessions/). -*Currently we don't have an example for calling `getAiSessionsV2026R0` in integration tests* + +``` +client.getAiSessions().getAiSessionsV2026R0(new GetAiSessionsV2026R0QueryParams(GetAiSessionsV2026R0QueryParamsSourceField.API)) +``` ### Arguments @@ -55,7 +58,10 @@ This operation is performed by calling function `deleteAiSessionByIdV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/delete-ai-sessions-id/). -*Currently we don't have an example for calling `deleteAiSessionByIdV2026R0` in integration tests* + +``` +client.getAiSessions().deleteAiSessionByIdV2026R0(aiSessionId) +``` ### Arguments diff --git a/src/intTest/java/com/box/sdkgen/aisessions/AiSessionsITest.java b/src/intTest/java/com/box/sdkgen/aisessions/AiSessionsITest.java new file mode 100644 index 000000000..ed60bcb22 --- /dev/null +++ b/src/intTest/java/com/box/sdkgen/aisessions/AiSessionsITest.java @@ -0,0 +1,30 @@ +package com.box.sdkgen.aisessions; + +import static com.box.sdkgen.commons.CommonsManager.getDefaultClient; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.box.sdkgen.client.BoxClient; +import com.box.sdkgen.managers.aisessions.GetAiSessionsV2026R0QueryParams; +import com.box.sdkgen.managers.aisessions.GetAiSessionsV2026R0QueryParamsSourceField; +import com.box.sdkgen.schemas.v2026r0.aisessionsv2026r0.AiSessionsV2026R0; +import org.junit.jupiter.api.Test; + +public class AiSessionsITest { + + private static final BoxClient client = getDefaultClient(); + + @Test + public void testAiSessionsWithNonExistentIdV2026R0() { + String aiSessionId = "123456"; + AiSessionsV2026R0 aiSessions = + client + .getAiSessions() + .getAiSessionsV2026R0( + new GetAiSessionsV2026R0QueryParams( + GetAiSessionsV2026R0QueryParamsSourceField.API)); + assert aiSessions.getEntries().size() >= 0; + assertThrows( + RuntimeException.class, + () -> client.getAiSessions().deleteAiSessionByIdV2026R0(aiSessionId)); + } +}