use of com.walmartlabs.concord.plugins.packer.commands.Version in project concord-plugins by walmartlabs.
the class PackerTaskTest method valiateDownloadingNonDefaultVersionOfPacker.
@Test
public void valiateDownloadingNonDefaultVersionOfPacker() throws Exception {
ToolInitializer toolInitializer = new ToolInitializer(new OKHttpDownloadManager("packer"));
Map<String, ToolCommand> commands = ImmutableMap.of("packer/version", new Version());
PackerTask task = new PackerTask(commands, toolInitializer);
Map<String, Object> args = Maps.newHashMap(mapBuilder().put("version", "1.5.2").put("command", "version").put("saveOutput", true).build());
Context context = context(args);
task.execute(context);
String expectedCommandLine = "packer version";
assertThat(normalizedCommandLineArguments(context)).isEqualTo(expectedCommandLine);
// Retrieve the logs from the context and assert we retrieved an alternate version
assertThat(varAsString(context, "logs")).contains("Packer v1.5.2");
}
Aggregations