PlantUMLContentTransformer extends AbstractContentTransformer { public void setDataProvider(PlantUMLDataProvider provider) { this.provider=provider; }  void setDataProvider(PlantUMLDataProvider provider); @Override boolean isTransforming(Object data);  }
@Test public void data_provider_gives_SVG_so_outputformat_svg() { ContentTransformerData data = new ContentTransformerData(); data.filename="filename"; data.origin="origin"; transformerToTest.setDataProvider(new PlantUMLDataProvider() { @Override public PlantUMLOutputFormat getOutputFormat() { return PlantUMLOutputFormat.SVG; } }); String result = transformerToTest.transform(data); assertEquals("[plantuml,filename,svg]\n" + "----\n" + "origin\n" + "----\n" + "", result); }
@Test public void data_provider_gives_PNG_so_outputformat_png() { ContentTransformerData data = new ContentTransformerData(); data.filename="filename"; data.origin="origin"; transformerToTest.setDataProvider(new PlantUMLDataProvider() { @Override public PlantUMLOutputFormat getOutputFormat() { return PlantUMLOutputFormat.PNG; } }); String result = transformerToTest.transform(data); assertEquals("[plantuml,filename,png]\n" + "----\n" + "origin\n" + "----\n" + "", result); }
@Test public void data_provider_gives_TXT_so_outputformat_txt() { ContentTransformerData data = new ContentTransformerData(); data.filename="filename"; data.origin="origin"; transformerToTest.setDataProvider(new PlantUMLDataProvider() { @Override public PlantUMLOutputFormat getOutputFormat() { return PlantUMLOutputFormat.TXT; } }); String result = transformerToTest.transform(data); assertEquals("[plantuml,filename,txt]\n" + "----\n" + "origin\n" + "----\n" + "", result); }