when(commandExecutor.execute(any(Command.class), any(StreamConsumer.class), any(StreamConsumer.class), anyLong())).thenAnswer(new Answer<Integer>() {
@Override
public Integer answer(InvocationOnMock invocation) throws Throwable {
StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
outConsumer.consumeLine("2c68c473da7fc293e12ca50f19380c5118be7ead 68 54 1");
outConsumer.consumeLine("author Simon Brandhof");
outConsumer.consumeLine("author-mail <simon.brandhof@gmail.com>");
outConsumer.consumeLine("author-time 1312534171");
outConsumer.consumeLine("author-tz +0200");
outConsumer.consumeLine("committer Simon Brandhof");
outConsumer.consumeLine("committer-mail <simon.brandhof@gmail.com>");
outConsumer.consumeLine("committer-time 1312534171");
outConsumer.consumeLine("committer-tz +0200");
outConsumer.consumeLine("summary Move to nexus.codehaus.org + configuration of maven release plugin is back");
outConsumer.consumeLine("previous 1bec1c3a77f6957175be13e4433110f7fc8e387e pom.xml");
outConsumer.consumeLine("filename pom.xml");
outConsumer.consumeLine("\t<id>codehaus-nexus-staging</id>");
outConsumer.consumeLine("2c68c473da7fc293e12ca50f19380c5118be7ead 72 60 1");
outConsumer.consumeLine("\t<url>${sonar.snapshotRepository.url}</url>");
return 0;
}
});
when(input.filesToBlame()).thenReturn(Arrays.<InputFile>asList(inputFile));
new GitBlameCommand(commandExecutor).blame(input, result);