use of org.apache.metron.common.configuration.SensorParserConfig in project metron by apache.
the class CSVParserTest method getsReadCharsetFromConfig.
@Test
public void getsReadCharsetFromConfig() throws IOException {
SensorParserConfig config = JSONUtils.INSTANCE.load(parserConfig, SensorParserConfig.class);
CSVParser parser = new CSVParser();
parser.init();
config.getParserConfig().put(MessageParser.READ_CHARSET, StandardCharsets.UTF_16.toString());
parser.configure(config.getParserConfig());
assertThat(parser.getReadCharset(), equalTo(StandardCharsets.UTF_16));
}
use of org.apache.metron.common.configuration.SensorParserConfig in project metron by apache.
the class CSVParserTest method getsReadCharsetFromDefault.
@Test
public void getsReadCharsetFromDefault() throws IOException {
SensorParserConfig config = JSONUtils.INSTANCE.load(parserConfig, SensorParserConfig.class);
CSVParser parser = new CSVParser();
parser.init();
parser.configure(config.getParserConfig());
assertThat(parser.getReadCharset(), equalTo(StandardCharsets.UTF_8));
}
Aggregations