Repository navigation
deleteStorageFile: accept tb:// URL; fix README snippets that don't compile - #26
Conversation
deleteStorageFile(appUrl) sent DELETE /v1/storage/tb%3A%2F%2F<id> and the API answered 'Nothing found for tb://<id>', while getStorageFile already strips the tb:// prefix. Strip it here too (plain ids still work). README: getDevices() has no zero-arg overload (use offset/count), getAvailableDevices() returns List, updateUserInfo returns boolean, the Maven snippet pinned 1.0.8 and was missing '>' on </dependencies>, and the badge said Java 1.7+ while the build targets Java 8.
There was a problem hiding this comment.
🟡 Changes recommended
The README contains two active code-snippet issues that prevent the documented Java examples from compiling as written.
2 open issues
What changed in this PR
Updates the Java client to support deleting storage files via tb:// URLs and refreshes README examples and dependency metadata.
Changes:
- Normalize
tb://URLs before constructing storage deletion requests. - Add mock coverage for deletion using a
tb://URL. - Update README API examples, Java compatibility information, and Maven dependency configuration.
| File | Summary |
|---|---|
src/test/java/com/testingbot/testingbotrest/TestingbotRestMockTest.java |
Adds regression coverage for deleting a storage file through a tb:// URL. |
src/main/java/com/testingbot/testingbotrest/TestingbotREST.java |
Strips the tb:// prefix when building storage deletion requests. |
README.md |
Refreshes API signatures, Java version information, and Maven metadata; two minor snippet nits remain regarding argument expressions and the undeclared user variable. |
Review effort: Lite
|
|
||
| ```java | ||
| ArrayList<TestingbotDevice> devices = restApi.getDevices(); | ||
| List<TestingbotDevice> devices = restApi.getDevices(int offset, int count); |
There was a problem hiding this comment.
Intentional. This README documents each method in signature style, e.g. getDevice(int deviceId), stopTest(String sessionId), getTests(int offset, int count) and getStorageFiles(int offset, int count), and this line now follows that convention. The bug fixed here is that the zero-arg getDevices() it showed does not exist at all. Converting the whole README to runnable snippets is out of scope for this PR.
|
|
||
| ```java | ||
| TestingbotUser user = restApi.updateUserInfo(TestingBotUser); | ||
| boolean success = restApi.updateUserInfo(TestingbotUser user); |
There was a problem hiding this comment.
Same as above: signature-style documentation, consistent with the rest of the README (e.g. updateTest(TestingbotTest test)). The fix is the return type (boolean, not TestingbotUser) and the class-name casing (TestingbotUser).

Part of https://testingbot-team.atlassian.net/browse/TB-1008 (docs audit: run every SDK README snippet).
README walkthrough against Maven Central 1.1.0
I compiled a program that uses the README snippets and ran it against the live API (
maven:3.9-eclipse-temurin-21).Doesn't compile as written:
ArrayList<TestingbotDevice> devices = restApi.getDevices();: there is no zero-arggetDevices(only(int offset, int count)and(String platform, Boolean web)).ArrayList<TestingbotDevice> devices = restApi.getAvailableDevices();: the method returnsList.TestingbotUser user = restApi.updateUserInfo(...): the method returnsboolean.1.0.8(current is 1.1.0) and ends with</dependencies(no>).Runtime bug:
uploadToStorage(url)→getStorageFile(appUrl)works, butdeleteStorageFile(appUrl)with the sametb://…URL fails:getStorageFilestripstb://, butdeleteStorageFileURL-encoded it into the path.Changes
deleteStorageFilestripstb://, likegetStorageFile. Bare ids still work. Added a mock test for thetb://form.Verification
I deleted the test and storage entries the walkthrough created.
Release needed (Maven Central) for the
deleteStorageFilefix. That is needs-jochen. Side note: the pom on master says1.0.11-SNAPSHOTalthoughtestingbotrest-1.1.0is tagged and published.