public void testAllParams() {
CommandExecutor commandExecutor = mock(CommandExecutor.class);
Settings settings = new Settings(new PropertyDefinitions(SvnConfiguration.getProperties()));
SvnBlameCommand svnBlameCommand = new SvnBlameCommand(commandExecutor, new SvnConfiguration(settings));
Command commandLine = svnBlameCommand.createCommandLine(baseDir, "src/main/java/Foo.java");
assertThat(commandLine.toCommandLine()).isEqualTo("svn blame --xml --non-interactive -x -w src/main/java/Foo.java");
assertThat(commandLine.toString()).isEqualTo("svn blame --xml --non-interactive -x -w src/main/java/Foo.java");
settings.setProperty(SvnConfiguration.USER_PROP_KEY, "myUser");
settings.setProperty(SvnConfiguration.PASSWORD_PROP_KEY, "myPass");
commandLine = svnBlameCommand.createCommandLine(baseDir, "src/main/java/Foo.java");
assertThat(commandLine.toCommandLine()).isEqualTo("svn blame --xml --non-interactive -x -w --username myUser --password myPass src/main/java/Foo.java");
assertThat(commandLine.toString()).isEqualTo("svn blame --xml --non-interactive -x -w --username ******** --password ******** src/main/java/Foo.java");
settings.setProperty(SvnConfiguration.CONFIG_DIR_PROP_KEY, "/home/julien/.svn");
settings.setProperty(SvnConfiguration.TRUST_SERVER_PROP_KEY, "true");
settings.setProperty(SvnConfiguration.USE_MERGE_HISTORY_KEY, "true");
commandLine = svnBlameCommand.createCommandLine(baseDir, "src/main/java/Foo.java");
assertThat(commandLine.toCommandLine())
.isEqualTo(
"svn blame --xml --use-merge-history --non-interactive -x -w --config-dir /home/julien/.svn --username myUser --password myPass --trust-server-cert src/main/java/Foo.java");
assertThat(commandLine.toString())
.isEqualTo(
"svn blame --xml --use-merge-history --non-interactive -x -w --config-dir /home/julien/.svn --username ******** --password ******** --trust-server-cert src/main/java/Foo.java");
}