CSVSchemaParser implements SchemaParser { @Override public boolean accept(DataSetMetadata metadata) { if (metadata == null || metadata.getContent() == null) { return false; } return StringUtils.equals(metadata.getContent().getFormatFamilyId(), CSVFormatFamily.BEAN_ID); }  @Override boolean accept(DataSetMetadata metadata); @Override Schema parse(Request request); Map<String, String> guess(SchemaParser.Request request, String encoding); static final List<Character> DEFAULT_VALID_SEPARATORS; }
@Test public void should_accept_csv_update() throws Exception { final DataSetMetadata metadata = metadataBuilder.metadata().id("toto").formatFamilyId("formatGuess#csv").build(); assertTrue(csvSchemaParser.accept(metadata)); }
@Test public void should_not_accept_xls_update() throws Exception { final DataSetMetadata metadata = metadataBuilder.metadata().id("tata").formatFamilyId("formatGuess#xls").build(); assertFalse(csvSchemaParser.accept(metadata)); }
@Test public void should_not_accept_html_update() throws Exception { final DataSetMetadata metadata = metadataBuilder.metadata().id("tata").formatFamilyId("formatGuess#html").build(); assertFalse(csvSchemaParser.accept(metadata)); }