-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Issue #107 - add properties "options" and "id" to class Met… (
#109) * Implement Issue #107 - add properties "options" and "id" to class MetapropertiesQuery to support getting all metaproperties without options and retrieving individual metaproperties (with options if needed) * replace property "id" with "ids" in MetapropertyQuery to ensure a dictionary (Map) is returned, and so not break the retrofix introspection. Add basic unit tests for MetapropertyQuery. --------- Co-authored-by: Colin Manning <[email protected]>
- Loading branch information
1 parent
bf9abb6
commit e78f26a
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/test/java/com/bynder/sdk/query/MetapropertyQueryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.bynder.sdk.query; | ||
|
||
import com.bynder.sdk.model.MediaType; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNull; | ||
|
||
/** | ||
* Tests the {@link MetapropertyQuery} class methods. | ||
*/ | ||
public class MetapropertyQueryTest { | ||
|
||
public static final MediaType EXPECTED_MEDIA_TYPE = MediaType.IMAGE; | ||
public static final int EXPECTED_INTEGER = 1; | ||
public static final Boolean EXPECTED_BOOLEAN = Boolean.TRUE; | ||
|
||
public static final String EXPECTED_ID_LIST = "1,2,3,4,5"; | ||
|
||
private MetapropertyQuery metapropertyQuery; | ||
|
||
@Before | ||
public void setUp() { | ||
this.metapropertyQuery = new MetapropertyQuery(); | ||
} | ||
|
||
@Test | ||
public void initializeEmptyMetapropertyQuery() { | ||
assertNull(metapropertyQuery.getType()); | ||
assertNull(metapropertyQuery.getCount()); | ||
assertNull(metapropertyQuery.getOptions()); | ||
assertNull(metapropertyQuery.getIds()); | ||
} | ||
|
||
@Test | ||
public void setValuesForMediaQuery() { | ||
metapropertyQuery.setType(EXPECTED_MEDIA_TYPE); | ||
assertEquals(EXPECTED_MEDIA_TYPE, metapropertyQuery.getType()); | ||
|
||
metapropertyQuery.setCount(EXPECTED_BOOLEAN); | ||
assertEquals(EXPECTED_BOOLEAN, metapropertyQuery.getCount()); | ||
|
||
metapropertyQuery.setOptions(EXPECTED_BOOLEAN); | ||
assertEquals(EXPECTED_BOOLEAN, metapropertyQuery.getOptions()); | ||
|
||
metapropertyQuery.setIds(EXPECTED_ID_LIST); | ||
assertEquals(EXPECTED_ID_LIST, metapropertyQuery.getIds()); | ||
|
||
} | ||
} |