Skip to content

Commit a8d04f3

Browse files
Support Admin API ping
1 parent 55b2115 commit a8d04f3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

cloudinary-core/src/main/java/com/cloudinary/Api.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ public Api(Cloudinary cloudinary) {
9797
this.cloudinary = cloudinary;
9898
}
9999

100+
public Map ping(Map options) throws Exception {
101+
if (options == null) options = Cloudinary.emptyMap();
102+
return callApi(HttpMethod.GET, Arrays.asList("ping"), Cloudinary.emptyMap(), options);
103+
}
104+
100105
public Map usage(Map options) throws Exception {
101106
if (options == null) options = Cloudinary.emptyMap();
102107
return callApi(HttpMethod.GET, Arrays.asList("usage"), Cloudinary.emptyMap(), options);

cloudinary-core/src/test/java/com/cloudinary/test/ApiTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,13 @@ public void test18Usage() throws Exception {
307307
assertNotNull(result.get("last_updated"));
308308
}
309309

310+
@Test
311+
public void test19Ping() throws Exception {
312+
// should support ping API call
313+
Map result = api.ping(Cloudinary.emptyMap());
314+
assertEquals(result.get("status"), "ok");
315+
}
316+
310317
private void assertContains(Object object, Collection list) {
311318
assertTrue(list.contains(object));
312319
}

0 commit comments

Comments
 (0)