### Question:
TxtOutputConverter implements PluginOutputConverter { @Override public String convert(List<Plugin> plugins) { return plugins.stream() .map(this::mapPluginToTxtFormat) .collect(Collectors.joining(System.lineSeparator())); }  @Override String convert(List<Plugin> plugins);  }### Answer:
@Test public void convert() { List<Plugin> originalPlugins = singletonList(plugin("mailer", "1.31")); List<Plugin> latestVersionsOfPlugins = pm.getLatestVersionsOfPlugins(originalPlugins); String converted = new TxtOutputConverter().convert(latestVersionsOfPlugins); assertThat(converted) .isEqualTo("mailer:1.32"); }
@Test public void convertIncrementals() { List<Plugin> originalPlugins = singletonList(plugin("workflow-support", "2.19-rc289.d09828a05a74", "org.jenkins-ci.plugins.workflow")); List<Plugin> latestVersionsOfPlugins = pm.getLatestVersionsOfPlugins(originalPlugins); String converted = new TxtOutputConverter().convert(latestVersionsOfPlugins); assertThat(converted) .isEqualTo("workflow-support:incrementals;org.jenkins-ci.plugins.workflow;2.19-rc289.d09828a05a74"); }
@Test public void convertUrl() { List<Plugin> originalPlugins = singletonList(pluginWithUrl("script-security", "http: List<Plugin> latestVersionsOfPlugins = pm.getLatestVersionsOfPlugins(originalPlugins); String converted = new TxtOutputConverter().convert(latestVersionsOfPlugins); assertThat(converted) .isEqualTo("script-security:latest:http: }
@Test public void convertNoUpdated() { List<Plugin> originalPlugins = singletonList(plugin("mailer", "1.32")); List<Plugin> latestVersionsOfPlugins = pm.getLatestVersionsOfPlugins(originalPlugins); String converted = new TxtOutputConverter().convert(latestVersionsOfPlugins); assertThat(converted) .isEqualTo("mailer:1.32"); }