@Test public void convertUrl() { List<Plugin> originalPlugins = singletonList(pluginWithUrl("script-security", "http: List<Plugin> latestVersionsOfPlugins = pm.getLatestVersionsOfPlugins(originalPlugins); String converted = new YamlPluginOutputConverter().convert(latestVersionsOfPlugins); assertThat(converted) .isEqualTo("plugins:\n" + "- artifactId: \"script-security\"\n" + " source:\n" + " version: \"latest\"\n" + " url: \"http: }
@Override public String convert(List<Plugin> plugins) { ObjectMapper mapper = new ObjectMapper(new YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER)) .setSerializationInclusion(JsonInclude.Include.NON_NULL); try { return mapper.writeValueAsString(mapToOutputFormat(plugins)); } catch (JsonProcessingException e) { e.printStackTrace(); return "Error converting to yaml"; } }
YamlPluginOutputConverter implements PluginOutputConverter { @Override public String convert(List<Plugin> plugins) { ObjectMapper mapper = new ObjectMapper(new YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER)) .setSerializationInclusion(JsonInclude.Include.NON_NULL); try { return mapper.writeValueAsString(mapToOutputFormat(plugins)); } catch (JsonProcessingException e) { e.printStackTrace(); return "Error converting to yaml"; } } }
YamlPluginOutputConverter implements PluginOutputConverter { @Override public String convert(List<Plugin> plugins) { ObjectMapper mapper = new ObjectMapper(new YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER)) .setSerializationInclusion(JsonInclude.Include.NON_NULL); try { return mapper.writeValueAsString(mapToOutputFormat(plugins)); } catch (JsonProcessingException e) { e.printStackTrace(); return "Error converting to yaml"; } }  }
YamlPluginOutputConverter implements PluginOutputConverter { @Override public String convert(List<Plugin> plugins) { ObjectMapper mapper = new ObjectMapper(new YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER)) .setSerializationInclusion(JsonInclude.Include.NON_NULL); try { return mapper.writeValueAsString(mapToOutputFormat(plugins)); } catch (JsonProcessingException e) { e.printStackTrace(); return "Error converting to yaml"; } }  @Override String convert(List<Plugin> plugins); }
YamlPluginOutputConverter implements PluginOutputConverter { @Override public String convert(List<Plugin> plugins) { ObjectMapper mapper = new ObjectMapper(new YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER)) .setSerializationInclusion(JsonInclude.Include.NON_NULL); try { return mapper.writeValueAsString(mapToOutputFormat(plugins)); } catch (JsonProcessingException e) { e.printStackTrace(); return "Error converting to yaml"; } }  @Override String convert(List<Plugin> plugins);  }