Skip to content

Commit b5c0cb3

Browse files
Merge pull request #26 from testingbot/fix/delete-storage-tb-url
deleteStorageFile: accept tb:// URL; fix README snippets that don't compile
2 parents 43ca47b + 418a45c commit b5c0cb3

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Tests](https://github.com/testingbot/testingbot-java/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/testingbot/testingbot-java/actions/workflows/test.yml)
44
[![CodeQL](https://github.com/testingbot/testingbot-java/actions/workflows/codeql-analysis.yml/badge.svg?branch=master)](https://github.com/testingbot/testingbot-java/actions/workflows/codeql-analysis.yml)
55
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
6-
[![Java](https://img.shields.io/badge/Java-1.7%2B-blue.svg)](https://www.oracle.com/java/)
6+
[![Java](https://img.shields.io/badge/Java-8%2B-blue.svg)](https://www.oracle.com/java/)
77

88
TestingBotREST Java
99
====================
@@ -36,7 +36,7 @@ Retrieves collection of available browsers
3636

3737

3838
```java
39-
ArrayList<TestingbotBrowser> devices = restApi.getBrowsers();
39+
ArrayList<TestingbotBrowser> browsers = restApi.getBrowsers();
4040
```
4141

4242
### getDevices
@@ -45,7 +45,7 @@ Retrieves collection of available devices
4545

4646

4747
```java
48-
ArrayList<TestingbotDevice> devices = restApi.getDevices();
48+
List<TestingbotDevice> devices = restApi.getDevices(int offset, int count);
4949
```
5050

5151
### getAvailableDevices
@@ -54,7 +54,7 @@ Retrieves collection of available devices
5454

5555

5656
```java
57-
ArrayList<TestingbotDevice> devices = restApi.getAvailableDevices();
57+
List<TestingbotDevice> devices = restApi.getAvailableDevices();
5858
```
5959

6060
### getDevice
@@ -150,7 +150,7 @@ Updates information about the current user
150150

151151

152152
```java
153-
TestingbotUser user = restApi.updateUserInfo(TestingBotUser);
153+
boolean success = restApi.updateUserInfo(TestingbotUser user);
154154
```
155155

156156
### getTunnels
@@ -406,8 +406,8 @@ Maven
406406
<dependency>
407407
<groupId>com.testingbot</groupId>
408408
<artifactId>testingbotrest</artifactId>
409-
<version>1.0.8</version>
409+
<version>1.1.0</version>
410410
<scope>test</scope>
411411
</dependency>
412-
</dependencies
412+
</dependencies>
413413
```

‎src/main/java/com/testingbot/testingbotrest/TestingbotREST.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ public TestingbotDevice getDevice(int deviceId) {
431431
* @return boolean success
432432
*/
433433
public boolean deleteStorageFile(String appUrl) {
434-
return this.apiBoolean(new HttpDelete(apiBase + "/storage/" + enc(appUrl)), null);
434+
return this.apiBoolean(new HttpDelete(apiBase + "/storage/" + enc(appUrl.replace("tb://", ""))), null);
435435
}
436436

437437

‎src/test/java/com/testingbot/testingbotrest/TestingbotRestMockTest.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,12 @@ public void deleteStorageFile() {
404404
assertRequest("DELETE", "/v1/storage/xyz");
405405
}
406406

407+
@Test
408+
public void deleteStorageFileAcceptsAppUrl() {
409+
api.deleteStorageFile("tb://xyz");
410+
assertRequest("DELETE", "/v1/storage/xyz");
411+
}
412+
407413
// ------------------------------------------------------------------ jobs / config
408414

409415
@Test

0 commit comments

Comments
 (0)