Skip to content

Commit 8e5994f

Browse files
committed
[WIP] Test webooks
1 parent ceae00e commit 8e5994f

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/example/java/com/box/sdk/example/Main.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.box.sdk.example;
22

33
import com.box.sdk.BoxAPIConnection;
4+
import com.box.sdk.BoxAPIException;
5+
import com.box.sdk.BoxFile;
46
import com.box.sdk.BoxFolder;
57
import com.box.sdk.BoxItem;
68
import com.box.sdk.BoxLogger;
@@ -18,12 +20,7 @@ public static void main(String[] args) {
1820
BoxLogger.defaultLogger().setLevelToWarning();
1921

2022
BoxAPIConnection api = new BoxAPIConnection(DEVELOPER_TOKEN);
21-
22-
BoxUser.Info userInfo = BoxUser.getCurrentUser(api).getInfo();
23-
System.out.format("Welcome, %s <%s>!\n\n", userInfo.getName(), userInfo.getLogin());
24-
2523
BoxFolder rootFolder = BoxFolder.getRootFolder(api);
26-
listFolder(rootFolder, 0);
2724
}
2825

2926
private static void listFolder(BoxFolder folder, int depth) {

src/intTest/java/com/box/sdk/BoxWebHookIT.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,21 @@ public void createWebHookSignRequestOnFolderSucceeds() throws IOException {
207207
}
208208
}
209209

210+
@Test
211+
public void listAllWebhooks() throws IOException {
212+
BoxAPIConnection api = jwtApiForServiceAccount();
213+
214+
try {
215+
Iterable<BoxWebHook.Info> webhooks = BoxWebHook.all(api);
216+
for (BoxWebHook.Info info : webhooks) {
217+
System.out.println("WebHook ID: " + info.getID());
218+
}
219+
220+
throw new BoxAPIException("Just for test for test");
221+
} finally {
222+
}
223+
}
224+
210225
private <T> Set<T> toSet(T[] values) {
211226
return new HashSet<>(Arrays.asList(values));
212227
}

0 commit comments

Comments
 (0)