-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:adobe/asset-share-commons into d…
…evelop
- Loading branch information
Showing
5 changed files
with
76 additions
and
14 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
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
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
43 changes: 43 additions & 0 deletions
43
...src/test/java/com/adobe/aem/commons/assetshare/content/renditions/AssetRenditionTest.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,43 @@ | ||
package com.adobe.aem.commons.assetshare.content.renditions; | ||
|
||
import com.adobe.aem.commons.assetshare.util.UrlUtil; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class AssetRenditionTest { | ||
|
||
@Test | ||
public void getBinaryUri() { | ||
|
||
AssetRendition assetRendition = new AssetRendition("/content/dam/test.jpg", 123L, "image/jpeg"); | ||
assertEquals("/content/dam/test.jpg", assetRendition.getBinaryUri().toString()); | ||
|
||
assetRendition = new AssetRendition("/content/dam/test asset.jpg", 123L, "image/jpeg"); | ||
assertEquals("/content/dam/test%20asset.jpg", assetRendition.getBinaryUri().toString()); | ||
|
||
assetRendition = new AssetRendition("/content/dam/test+with+plus.jpg", 123L, "image/jpeg"); | ||
assertEquals("/content/dam/test%2bwith%2bplus.jpg", assetRendition.getBinaryUri().toString()); | ||
|
||
assetRendition = new AssetRendition("https://test.com/content/dam/test asset.jpg", 123L, "image/jpeg"); | ||
assertEquals("https://test.com/content/dam/test%20asset.jpg", assetRendition.getBinaryUri().toString()); | ||
|
||
assetRendition = new AssetRendition("https://smartimaging.scene7.com/is/image/DynamicMediaNA/test (test):Medium", 123L, "image/jpeg"); | ||
assertEquals("https://smartimaging.scene7.com/is/image/DynamicMediaNA/test%20(test)%3aMedium", assetRendition.getBinaryUri().toString()); | ||
|
||
assetRendition = new AssetRendition("https://smartimaging.scene7.com/is/image/DynamicMediaNA/test (test)?$grayscale$", 123L, "image/jpeg"); | ||
assertEquals("https://smartimaging.scene7.com/is/image/DynamicMediaNA/test%20(test)?$grayscale$", assetRendition.getBinaryUri().toString()); | ||
} | ||
|
||
@Test | ||
public void getSize() { | ||
AssetRendition assetRendition = new AssetRendition("/content/dam/test.jpg", 123L, "image/jpeg"); | ||
assertEquals(Long.valueOf(123), assetRendition.getSize().get()); | ||
} | ||
|
||
@Test | ||
public void getMimeType() { | ||
AssetRendition assetRendition = new AssetRendition("/content/dam/test.jpg", 123L, "image/jpeg"); | ||
assertEquals("image/jpeg", assetRendition.getMimeType()); | ||
} | ||
} |
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