Skip to content

Commit 48351c7

Browse files
committed
Fixed failing delete test. Cause: assuming deleted_at was always there or had a valid value.
1 parent ce1cf8b commit 48351c7

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/com/cloudapp/impl/model/CloudAppItemImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public boolean isSubscribed() throws CloudAppException {
3131
}
3232

3333
public boolean isTrashed() throws CloudAppException {
34-
Date d = getDeletedAt();
35-
return d != null;
34+
String d = getString("deleted_at");
35+
return (d == null || d == "null");
3636
}
3737

3838
public String getUrl() throws CloudAppException {

src/test/java/com/cloudapp/impl/CloudAppItemsImplTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public void testDelete() throws JSONException, CloudAppException {
4949
@Test
5050
public void testUpload() throws CloudAppException, JSONException {
5151
CloudAppItem o = api.upload(file);
52+
Assert.assertNotNull(o);
5253
assertEquals("test_file.txt", o.getName());
54+
Assert.assertNotNull(o.getCreatedAt());
5355
}
5456
}

0 commit comments

Comments
 (0)