Skip to content

Commit

Permalink
update changelog, improve unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Sep 9, 2024
1 parent c6730b7 commit 89497b0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
<body>

<release version="5.6.2" date="not released">
<action type="update" dev="jhoh" issue="50">
Add support for Rendition.getBinary() method.
</action>
<action type="update" dev="sseifert">
Update to latest OSGi Mock.
</action>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public void dispose() {

@Override
public @Nullable URI getURI(BinaryDownloadOptions downloadOptions) throws RepositoryException {
final String path = "https://blostore.local:12345/blostore/" + rendition.getPath();
final String path = "https://blostore.local/blostore/" + rendition.getPath();
try {
return new URI(path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

import javax.jcr.Binary;
import javax.jcr.RepositoryException;

import org.apache.jackrabbit.api.binary.BinaryDownload;
Expand Down Expand Up @@ -100,8 +102,14 @@ public void testAdaptTo() {

@Test
public void testBinaryDownload() throws RepositoryException {
BinaryDownload d = (BinaryDownload)rendition.getBinary();
assertNotNull(d.getURI(null));
Binary binary = rendition.getBinary();
assertNotNull(binary);
assertEquals(0L, binary.getSize());
assertNotNull(binary.getStream());

assertTrue(binary instanceof BinaryDownload);
assertEquals("https://blostore.local/blostore//content/dam/sample/portraits/scott_reynolds.jpg/jcr:content/renditions/original",
((BinaryDownload)binary).getURI(null).toString());
}

}

0 comments on commit 89497b0

Please sign in to comment.