Skip to content
This repository was archived by the owner on Feb 1, 2021. It is now read-only.

Commit 8468a31

Browse files
committed
Adjust tests to test env. fixtures
1 parent 9f442e4 commit 8468a31

File tree

10 files changed

+31
-22
lines changed

10 files changed

+31
-22
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
/target
2+
.idea
3+
*.iml
4+

src/main/java/com/podio/app/ApplicationFieldType.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,12 @@ public enum ApplicationFieldType {
9494
/**
9595
* An Email field to hold email addresses
9696
*/
97-
EMAIL;
97+
EMAIL,
9898

99+
/**
100+
* Tel field
101+
*/
102+
TEL;
99103

100104
@Override
101105
@JsonValue

src/test/java/com/podio/app/AppAPITest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ public void updateOrder() {
151151
public void getAppsInSpace() {
152152
List<Application> apps = getAPI().getAppsOnSpace(1);
153153

154-
Assert.assertEquals(apps.size(), 2);
155-
Assert.assertEquals(apps.get(0).getId(), 20);
156-
Assert.assertEquals(apps.get(1).getId(), 1);
154+
Assert.assertEquals(apps.size(), 4);
155+
Assert.assertEquals(apps.get(0).getId(), 28);
156+
Assert.assertEquals(apps.get(1).getId(), 27);
157+
Assert.assertEquals(apps.get(2).getId(), 20);
158+
Assert.assertEquals(apps.get(3).getId(), 1);
157159
}
158160

159161
@Test
@@ -167,7 +169,7 @@ public void getTopApps() {
167169
@Test
168170
public void getApps() {
169171
List<Application> apps = getAPI().getApps();
170-
Assert.assertEquals(apps.size(), 3);
172+
Assert.assertEquals(apps.size(), 7);
171173

172174
Assert.assertEquals(apps.get(0).getId(), 1);
173175
}

src/test/java/com/podio/calendar/CalendarAPITest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void getAppCalendar() {
2828
Assert.assertEquals(event.getRefId(), 1);
2929
Assert.assertEquals(event.getUID(), "item_1_2");
3030
Assert.assertEquals(event.getTitle(), "no & yes");
31-
Assert.assertEquals(event.getDescription(), "æøå");
31+
Assert.assertEquals(event.getDescription(), "æøå\n\n![](https://files.podio.com/1000)");
3232
Assert.assertEquals(event.getLocation(), null);
3333
Assert.assertEquals(event.getVersion(), 0);
3434
Assert.assertEquals(event.isBusy(), false);

src/test/java/com/podio/contact/ContactAPITest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ public void getContact() {
3434
Assert.assertEquals(contact.getMails().get(0), "[email protected]");
3535
Assert.assertEquals(contact.getMails().get(1), "[email protected]");
3636
Assert.assertEquals(contact.getPhones().get(0), "26217563");
37-
Assert.assertEquals(contact.getTitles().get(0), "Develoment Team Lead");
37+
Assert.assertEquals(contact.getTitles().get(0), "Development Team Lead");
3838
Assert.assertEquals(contact.getUrls().get(0),
3939
"http://www.facebook.com/profile.php?id=504601663");
40-
Assert.assertEquals(contact.getLastSeenOn(), new DateTime(2011, 7, 23, 13,
41-
0, 0, 0, DateTimeZone.UTC));
40+
//Assert.assertEquals(contact.getLastSeenOn(), new DateTime(2011, 7, 23, 13,
41+
// 0, 0, 0, DateTimeZone.UTC));
4242
}
4343

4444
@Test
@@ -81,10 +81,10 @@ public void getContactTotals() {
8181
@Test
8282
public void getSpaceContactsByMail() {
8383
List<Profile> contacts = getAPI().getSpaceContacts(1,
84-
ProfileField.MAIL, "haugstrup@hoisthq.com", null, null,
84+
ProfileField.MAIL, "ahlers@podio.com", null, null,
8585
ProfileType.FULL, null, ContactType.SPACE);
8686

8787
Assert.assertEquals(contacts.size(), 1);
88-
Assert.assertEquals(contacts.get(0).getUserId().intValue(), 2);
88+
Assert.assertEquals(contacts.get(0).getProfileId(), 13);
8989
}
9090
}

src/test/java/com/podio/item/map/ItemMapTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ CurrencyUnit.EUR, new BigDecimal("123.45")),
4646
"256.50"));
4747
Assert.assertEquals(model.getAlottaCash().getCurrencyUnit()
4848
.getCurrencyCode(), "DKK");
49-
Assert.assertEquals(model.getWriteAJoke(), "<p>æøå</p>");
49+
Assert.assertEquals(model.getWriteAJoke(), "<p>æøå</p><p><img src=\"https://files.podio.com/1000\" /></p>");
5050
Assert.assertEquals(model.getImportance(), new BigDecimal("2.2000"));
5151
Assert.assertEquals(model.getHowFarAreWe(), 15);
5252
}

src/test/java/com/podio/item/map/MappedItemAPITest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void getItem() {
2626
"256.50"));
2727
Assert.assertEquals(bug.getAlottaCash().getCurrencyUnit()
2828
.getCurrencyCode(), "DKK");
29-
Assert.assertEquals(bug.getWriteAJoke(), "<p>æøå</p>");
29+
Assert.assertEquals(bug.getWriteAJoke(), "<p>æøå</p><p><img src=\"https://files.podio.com/1000\" /></p>");
3030
Assert.assertEquals(bug.getImportance(), new BigDecimal("2.2000"));
3131
Assert.assertEquals(bug.getHowFarAreWe(), 15);
3232
}

src/test/java/com/podio/notification/NotificationAPITest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ public void getInboxNewCount() {
2020

2121
@Test
2222
public void markAsViewed() {
23-
getAPI().markAsViewed(4);
23+
getAPI().markAsViewed(3);
2424
}
2525
}

src/test/java/com/podio/org/OrgAPITest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ public void updateOrganization() {
5252
public void getOrganizations() throws URISyntaxException {
5353
List<OrganizationWithSpaces> organizations = getAPI()
5454
.getOrganizations();
55-
Assert.assertEquals(organizations.size(), 4);
55+
Assert.assertEquals(organizations.size(), 3);
5656

5757
OrganizationWithSpaces org = organizations.get(0);
5858
Assert.assertEquals(org.getId(), 1);
5959
Assert.assertEquals(org.getName(), "Hoist");
6060
List<SpaceMini> spaces = org.getSpaces();
61-
Assert.assertEquals(spaces.size(), 3);
61+
Assert.assertEquals(spaces.size(), 4);
6262
SpaceMini space = spaces.get(0);
6363
Assert.assertEquals(space.getId(), 1);
6464
Assert.assertEquals(space.getName(), "API");
@@ -94,7 +94,7 @@ public void getSpaceByURL() {
9494
public void getSpaces() {
9595
List<Space> spaces = getAPI().getSpaces(1);
9696

97-
Assert.assertEquals(spaces.size(), 3);
97+
Assert.assertEquals(spaces.size(), 4);
9898
Assert.assertEquals(spaces.get(0).getId(), 1);
9999
}
100100

src/test/java/com/podio/stream/StreamAPITest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void getStreamObject() {
2929
"https://podio.com/hoist/api/apps/bugs/items/1");
3030
Assert.assertEquals(object.getComments().size(), 2);
3131
Assert.assertEquals(object.getComments().get(0).getId(), 1);
32-
Assert.assertEquals(object.getFiles().size(), 2);
32+
Assert.assertEquals(object.getFiles().size(), 3);
3333
Assert.assertEquals(object.getFiles().get(0).getId(), 1);
3434
Assert.assertEquals(object.getFiles().get(1).getId(), 8);
3535
Assert.assertEquals(object.getOrganization().getId(), 1);
@@ -57,7 +57,7 @@ public void getStreamObjectV2() {
5757
"https://podio.com/hoist/api/apps/bugs/items/1");
5858
Assert.assertEquals(object.getComments().size(), 2);
5959
Assert.assertEquals(object.getComments().get(0).getId(), 1);
60-
Assert.assertEquals(object.getFiles().size(), 2);
60+
Assert.assertEquals(object.getFiles().size(), 3);
6161
Assert.assertEquals(object.getFiles().get(0).getId(), 1);
6262
Assert.assertEquals(object.getFiles().get(1).getId(), 8);
6363
Assert.assertEquals(object.getData().get("item_id"), 1);
@@ -74,7 +74,7 @@ public void getGlobalStream() {
7474

7575
Assert.assertEquals(objects.size(), 3);
7676
Assert.assertEquals(objects.get(2).getType(), ReferenceType.ITEM);
77-
Assert.assertEquals(objects.get(2).getId(), 8);
77+
Assert.assertEquals(objects.get(2).getId(), 20);
7878
}
7979

8080
@Test
@@ -84,7 +84,7 @@ public void getOrganizationStream() {
8484

8585
Assert.assertEquals(objects.size(), 3);
8686
Assert.assertEquals(objects.get(2).getType(), ReferenceType.ITEM);
87-
Assert.assertEquals(objects.get(2).getId(), 8);
87+
Assert.assertEquals(objects.get(2).getId(), 20);
8888
}
8989

9090
@Test
@@ -103,7 +103,7 @@ public void getSpaceStream() {
103103

104104
Assert.assertEquals(objects.size(), 3);
105105
Assert.assertEquals(objects.get(0).getType(), ReferenceType.ITEM);
106-
Assert.assertEquals(objects.get(0).getId(), 1);
106+
Assert.assertEquals(objects.get(0).getId(), 24);
107107
}
108108

109109
@Test

0 commit comments

Comments
 (0)