summaryrefslogtreecommitdiff
path: root/src/test/java/com/p4square/ccbapi/model/GetCustomFieldLabelsResponseTest.java
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2016-03-19 02:05:33 -0700
committerJesse Morgan <jesse@jesterpm.net>2016-03-19 02:07:24 -0700
commitb9eb1329a6dbec7b75c21d8e0eb13134121db6bb (patch)
treefec73ab32ff625c304513c24e864809845eede1a /src/test/java/com/p4square/ccbapi/model/GetCustomFieldLabelsResponseTest.java
Initial commit for the CCB API Client.
The client currently supports the following APIs: * individual_profiles * individual_profile_from_id * individual_profile_from_login_password * individual_profile_from_micr * custom_field_labels
Diffstat (limited to 'src/test/java/com/p4square/ccbapi/model/GetCustomFieldLabelsResponseTest.java')
-rw-r--r--src/test/java/com/p4square/ccbapi/model/GetCustomFieldLabelsResponseTest.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/test/java/com/p4square/ccbapi/model/GetCustomFieldLabelsResponseTest.java b/src/test/java/com/p4square/ccbapi/model/GetCustomFieldLabelsResponseTest.java
new file mode 100644
index 0000000..549b8e9
--- /dev/null
+++ b/src/test/java/com/p4square/ccbapi/model/GetCustomFieldLabelsResponseTest.java
@@ -0,0 +1,39 @@
+package com.p4square.ccbapi.model;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Tests for parsing GetCustomFieldLabelsResponse.
+ */
+public class GetCustomFieldLabelsResponseTest extends XmlBinderTestBase {
+
+ /**
+ * Assert that all of the fields bind appropriately in a GetCustomFieldLabelsResponse.
+ */
+ @Test
+ public void testGetCustomFieldLabelsResponse() throws Exception {
+ final GetCustomFieldLabelsResponse response = parseFile("ccb_custom_labels_response.xml",
+ GetCustomFieldLabelsResponse.class);
+
+ assertNull("Response should not have errors", response.getErrors());
+
+ assertNotNull(response.getCustomFields());
+ assertEquals(27, response.getCustomFields().size());
+
+ // Check the first field.
+ CustomField field = response.getCustomFields().get(0);
+ assertEquals("udf_ind_text_1", field.getName());
+ assertEquals("Favorite Movie", field.getLabel());
+ assertEquals(false, field.isAdminOnly());
+
+ // And the second.
+ field = response.getCustomFields().get(1);
+ assertEquals("udf_ind_text_2", field.getName());
+ assertEquals("Another Field", field.getLabel());
+ assertEquals(true, field.isAdminOnly());
+
+ // And that's probably enough for now...
+ }
+} \ No newline at end of file