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

Commit

Permalink
Adjust tests to test env. fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
mhrdev committed Mar 11, 2016
1 parent 9f442e4 commit 8468a31
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/target
.idea
*.iml

6 changes: 5 additions & 1 deletion src/main/java/com/podio/app/ApplicationFieldType.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ public enum ApplicationFieldType {
/**
* An Email field to hold email addresses
*/
EMAIL;
EMAIL,

/**
* Tel field
*/
TEL;

@Override
@JsonValue
Expand Down
10 changes: 6 additions & 4 deletions src/test/java/com/podio/app/AppAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,11 @@ public void updateOrder() {
public void getAppsInSpace() {
List<Application> apps = getAPI().getAppsOnSpace(1);

Assert.assertEquals(apps.size(), 2);
Assert.assertEquals(apps.get(0).getId(), 20);
Assert.assertEquals(apps.get(1).getId(), 1);
Assert.assertEquals(apps.size(), 4);
Assert.assertEquals(apps.get(0).getId(), 28);
Assert.assertEquals(apps.get(1).getId(), 27);
Assert.assertEquals(apps.get(2).getId(), 20);
Assert.assertEquals(apps.get(3).getId(), 1);
}

@Test
Expand All @@ -167,7 +169,7 @@ public void getTopApps() {
@Test
public void getApps() {
List<Application> apps = getAPI().getApps();
Assert.assertEquals(apps.size(), 3);
Assert.assertEquals(apps.size(), 7);

Assert.assertEquals(apps.get(0).getId(), 1);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/podio/calendar/CalendarAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void getAppCalendar() {
Assert.assertEquals(event.getRefId(), 1);
Assert.assertEquals(event.getUID(), "item_1_2");
Assert.assertEquals(event.getTitle(), "no & yes");
Assert.assertEquals(event.getDescription(), "æøå");
Assert.assertEquals(event.getDescription(), "æøå\n\n![](https://files.podio.com/1000)");
Assert.assertEquals(event.getLocation(), null);
Assert.assertEquals(event.getVersion(), 0);
Assert.assertEquals(event.isBusy(), false);
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/com/podio/contact/ContactAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public void getContact() {
Assert.assertEquals(contact.getMails().get(0), "dev@hoisthq.com");
Assert.assertEquals(contact.getMails().get(1), "holm@hoisthq.com");
Assert.assertEquals(contact.getPhones().get(0), "26217563");
Assert.assertEquals(contact.getTitles().get(0), "Develoment Team Lead");
Assert.assertEquals(contact.getTitles().get(0), "Development Team Lead");
Assert.assertEquals(contact.getUrls().get(0),
"http://www.facebook.com/profile.php?id=504601663");
Assert.assertEquals(contact.getLastSeenOn(), new DateTime(2011, 7, 23, 13,
0, 0, 0, DateTimeZone.UTC));
//Assert.assertEquals(contact.getLastSeenOn(), new DateTime(2011, 7, 23, 13,
// 0, 0, 0, DateTimeZone.UTC));
}

@Test
Expand Down Expand Up @@ -81,10 +81,10 @@ public void getContactTotals() {
@Test
public void getSpaceContactsByMail() {
List<Profile> contacts = getAPI().getSpaceContacts(1,
ProfileField.MAIL, "haugstrup@hoisthq.com", null, null,
ProfileField.MAIL, "ahlers@podio.com", null, null,
ProfileType.FULL, null, ContactType.SPACE);

Assert.assertEquals(contacts.size(), 1);
Assert.assertEquals(contacts.get(0).getUserId().intValue(), 2);
Assert.assertEquals(contacts.get(0).getProfileId(), 13);
}
}
2 changes: 1 addition & 1 deletion src/test/java/com/podio/item/map/ItemMapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CurrencyUnit.EUR, new BigDecimal("123.45")),
"256.50"));
Assert.assertEquals(model.getAlottaCash().getCurrencyUnit()
.getCurrencyCode(), "DKK");
Assert.assertEquals(model.getWriteAJoke(), "<p>æøå</p>");
Assert.assertEquals(model.getWriteAJoke(), "<p>æøå</p><p><img src=\"https://files.podio.com/1000\" /></p>");
Assert.assertEquals(model.getImportance(), new BigDecimal("2.2000"));
Assert.assertEquals(model.getHowFarAreWe(), 15);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/podio/item/map/MappedItemAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void getItem() {
"256.50"));
Assert.assertEquals(bug.getAlottaCash().getCurrencyUnit()
.getCurrencyCode(), "DKK");
Assert.assertEquals(bug.getWriteAJoke(), "<p>æøå</p>");
Assert.assertEquals(bug.getWriteAJoke(), "<p>æøå</p><p><img src=\"https://files.podio.com/1000\" /></p>");
Assert.assertEquals(bug.getImportance(), new BigDecimal("2.2000"));
Assert.assertEquals(bug.getHowFarAreWe(), 15);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public void getInboxNewCount() {

@Test
public void markAsViewed() {
getAPI().markAsViewed(4);
getAPI().markAsViewed(3);
}
}
6 changes: 3 additions & 3 deletions src/test/java/com/podio/org/OrgAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ public void updateOrganization() {
public void getOrganizations() throws URISyntaxException {
List<OrganizationWithSpaces> organizations = getAPI()
.getOrganizations();
Assert.assertEquals(organizations.size(), 4);
Assert.assertEquals(organizations.size(), 3);

OrganizationWithSpaces org = organizations.get(0);
Assert.assertEquals(org.getId(), 1);
Assert.assertEquals(org.getName(), "Hoist");
List<SpaceMini> spaces = org.getSpaces();
Assert.assertEquals(spaces.size(), 3);
Assert.assertEquals(spaces.size(), 4);
SpaceMini space = spaces.get(0);
Assert.assertEquals(space.getId(), 1);
Assert.assertEquals(space.getName(), "API");
Expand Down Expand Up @@ -94,7 +94,7 @@ public void getSpaceByURL() {
public void getSpaces() {
List<Space> spaces = getAPI().getSpaces(1);

Assert.assertEquals(spaces.size(), 3);
Assert.assertEquals(spaces.size(), 4);
Assert.assertEquals(spaces.get(0).getId(), 1);
}

Expand Down
10 changes: 5 additions & 5 deletions src/test/java/com/podio/stream/StreamAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void getStreamObject() {
"https://podio.com/hoist/api/apps/bugs/items/1");
Assert.assertEquals(object.getComments().size(), 2);
Assert.assertEquals(object.getComments().get(0).getId(), 1);
Assert.assertEquals(object.getFiles().size(), 2);
Assert.assertEquals(object.getFiles().size(), 3);
Assert.assertEquals(object.getFiles().get(0).getId(), 1);
Assert.assertEquals(object.getFiles().get(1).getId(), 8);
Assert.assertEquals(object.getOrganization().getId(), 1);
Expand Down Expand Up @@ -57,7 +57,7 @@ public void getStreamObjectV2() {
"https://podio.com/hoist/api/apps/bugs/items/1");
Assert.assertEquals(object.getComments().size(), 2);
Assert.assertEquals(object.getComments().get(0).getId(), 1);
Assert.assertEquals(object.getFiles().size(), 2);
Assert.assertEquals(object.getFiles().size(), 3);
Assert.assertEquals(object.getFiles().get(0).getId(), 1);
Assert.assertEquals(object.getFiles().get(1).getId(), 8);
Assert.assertEquals(object.getData().get("item_id"), 1);
Expand All @@ -74,7 +74,7 @@ public void getGlobalStream() {

Assert.assertEquals(objects.size(), 3);
Assert.assertEquals(objects.get(2).getType(), ReferenceType.ITEM);
Assert.assertEquals(objects.get(2).getId(), 8);
Assert.assertEquals(objects.get(2).getId(), 20);
}

@Test
Expand All @@ -84,7 +84,7 @@ public void getOrganizationStream() {

Assert.assertEquals(objects.size(), 3);
Assert.assertEquals(objects.get(2).getType(), ReferenceType.ITEM);
Assert.assertEquals(objects.get(2).getId(), 8);
Assert.assertEquals(objects.get(2).getId(), 20);
}

@Test
Expand All @@ -103,7 +103,7 @@ public void getSpaceStream() {

Assert.assertEquals(objects.size(), 3);
Assert.assertEquals(objects.get(0).getType(), ReferenceType.ITEM);
Assert.assertEquals(objects.get(0).getId(), 1);
Assert.assertEquals(objects.get(0).getId(), 24);
}

@Test
Expand Down

0 comments on commit 8468a31

Please sign in to comment.