Skip to content

Instantly share code, notes, and snippets.

@lmeadors
Created November 14, 2014 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmeadors/4c283b62c97653548337 to your computer and use it in GitHub Desktop.
Save lmeadors/4c283b62c97653548337 to your computer and use it in GitHub Desktop.
@Test
public void should_update_expaned_comic_to_s3() throws Exception {
final String comicFile = "test.cbz";
final EncodingStatus comicStatus = comicStatusService.create(comicFile);
comicStatus.setStatus(Status.UPLOAD);
when(directoryListProcessor.process(any(ExecResult.class))).thenReturn(new ArrayList<String>() {{
add("mediaKey/0001.jpeg");
add("mediaKey/0002.jpeg");
}});
listDirectory.setExpectedMessageCount(1);
listProcessor.setExpectedMessageCount(1);
loadFile.setExpectedMessageCount(2);
mimeType.setExpectedMessageCount(2);
s3.setExpectedMessageCount(2);
deleteDirectory.setExpectedMessageCount(1);
start.sendBody(xmlTestHelper.toXML(comicStatus));
assertMockEndpointsSatisfied();
final Exchange encodeComic = getCloudWatchExchange("EncodeComic", cloudWatch.getExchanges());
checkCloudWatchHeaders(encodeComic, "EncodeComic", "Count", "1");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment