### Question:
NonBinaryEnhancementProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { final Message in = exchange.getIn(); String uri = (String) in.getHeader(FCREPO_URI); String uuid = PIDs.get(uri).getUUID(); String objBasePath = idToPath(uuid, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); Path imgFile = Paths.get(sourceImagesDir, objBasePath, uuid); if (Files.isRegularFile(imgFile)) { in.setHeader(CdrBinaryPath, imgFile.toAbsolutePath().toString()); in.setHeader(CdrBinaryMimeType, "image/*"); } }  @Override void process(final Exchange exchange); void setSourceImagesDir(String sourceImagesDir);  }### Answer:
@Test public void testCollectionWithImage() throws Exception { String derivativeFinalPath = "de/75/d8/11/" + RESC_ID; Path uploadedFilePath = Paths.get(dataDir, derivativeFinalPath); Files.createDirectories(uploadedFilePath.getParent()); imgFile = new File(uploadedFilePath.toString()); FileUtils.writeStringToFile(imgFile, "image file", StandardCharsets.UTF_8); processor.process(exchange); verify(message).setHeader(CdrBinaryMimeType, "image/*"); verify(message).setHeader(CdrBinaryPath, imgFile.getAbsolutePath()); }
@Test public void testCollectionWithoutImage() throws Exception { imgFile = new File(dataDir + "/1234"); processor.process(exchange); verify(message, never()).setHeader(CdrBinaryMimeType, "image/*"); verify(message, never()).setHeader(CdrBinaryPath, imgFile.getAbsolutePath()); }