CSVFormat extends ExportFormat { @Override public List<Parameter> getParameters() { Locale currentLocale = getLocale(); return Arrays.asList( getFileName(currentLocale), getCsvDelimiters(currentLocale), getEnclosureChar(currentLocale), getEscapeChar(currentLocale), getEnclosureOptions(currentLocale), buildCharsetParameter(currentLocale)); } CSVFormat(); @Override List<Parameter> getParameters(); @Override int getOrder(); @Override boolean isCompatible(DataSetMetadata metadata); @Override boolean supportSampling(); static final String CSV; }
@Test public void csv() { final ExportFormatMessage exportFormatMessage = beanConversionService.convert(format, ExportFormatMessage.class); assertEquals("text/csv", exportFormatMessage.getMimeType()); assertEquals("CSV", exportFormatMessage.getId()); assertEquals("Local CSV file", exportFormatMessage.getName()); assertEquals(true, exportFormatMessage.isNeedParameters()); assertEquals(false, exportFormatMessage.isDefaultExport()); assertEquals(true, exportFormatMessage.isEnabled()); assertEquals("", exportFormatMessage.getDisableReason()); assertEquals("Export to CSV", exportFormatMessage.getTitle()); List<Parameter> parameters = exportFormatMessage.getParameters(); assertNotNull(parameters); assertEquals(6, parameters.size()); }