Skip to content

Commit

Permalink
Added uri property to UsageQuery (#119)
Browse files Browse the repository at this point in the history
* Added uri property

* Added unit test

* Extended unit test
  • Loading branch information
polanus authored Feb 12, 2024
1 parent 36d0b0a commit ea687fd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/com/bynder/sdk/query/UsageQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ public class UsageQuery {
@ApiField(name = "asset_id")
private String assetId;

/**
* Uri of the asset
*/
@ApiField(name = "uri")
private String uri;

public String getAssetId() {
return assetId;
}
Expand All @@ -27,4 +33,13 @@ public UsageQuery setAssetId(final String assetId) {
this.assetId = assetId;
return this;
}

public String getUri() {
return uri;
}

public UsageQuery setUri(final String uri) {
this.uri = uri;
return this;
}
}
8 changes: 8 additions & 0 deletions src/test/java/com/bynder/sdk/query/UsageQueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
public class UsageQueryTest {

public static final String EXPECTED_ASSET_ID = "assetId";
public static final String EXPECTED_URI = "uri";

private UsageQuery usageQuery;

Expand All @@ -33,11 +34,18 @@ public void setUp() {
@Test
public void initializeEmptyUsageQuery() {
assertNull(usageQuery.getAssetId());
assertNull(usageQuery.getUri());
}

@Test
public void setAssetIdForUsageQuery() {
usageQuery.setAssetId(EXPECTED_ASSET_ID);
assertEquals(EXPECTED_ASSET_ID, usageQuery.getAssetId());
}

@Test
public void setUriForUsageQuery() {
usageQuery.setUri(EXPECTED_URI);
assertEquals(EXPECTED_URI, usageQuery.getUri());
}
}

0 comments on commit ea687fd

Please sign in to comment.