Skip to content

Commit

Permalink
BXC-4712 fix import thumbnail router test
Browse files Browse the repository at this point in the history
  • Loading branch information
sharonluong committed Sep 23, 2024
1 parent eb77ca5 commit 6206d53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public void configure() throws Exception {

from("{{cdr.import.thumbnails.stream.camel}}")
.routeId("DcrImportThumbnails")
.process(importThumbnailRequestProcessor)
.log(DEBUG, log,
"Received thumbnail request: importing thumbnail for ${headers[CamelFcrepoUri]}")
.process(importThumbnailRequestProcessor)
.to("direct:process.enhancement.imageAccessCopy");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static org.fcrepo.camel.FcrepoHeaders.FCREPO_URI;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.verify;
import static org.mockito.MockitoAnnotations.openMocks;

public class ImportThumbnailProcessorTest {
Expand Down Expand Up @@ -54,14 +55,10 @@ public void testImportThumbnail() throws IOException {
var exchange = TestHelper.mockExchange(ImportThumbnailRequestSerializationHelper.toJson(request));
var message = exchange.getIn();

assertNull(message.getHeader(FCREPO_URI));
assertNull(message.getHeader(CdrBinaryMimeType));
assertNull(message.getHeader(CdrBinaryPath));

processor.process(exchange);

assertEquals(pid.getRepositoryUri(), message.getHeader(FCREPO_URI));
assertEquals(mimetype, message.getHeader(CdrBinaryMimeType));
assertEquals(path, message.getHeader(CdrBinaryPath));
verify(message).setHeader(FCREPO_URI, pid.getRepositoryUri());
verify(message).setHeader(CdrBinaryMimeType, mimetype);
verify(message).setHeader(CdrBinaryPath, path);
}
}

0 comments on commit 6206d53

Please sign in to comment.