MorphlineTranslator implements Translator, ProvidesAlias, ProvidesValidations,
    InstantiatesComponents { @Override public void configure(Config config) { LOG.debug("Configuring Morphline translator"); this.keyEncoding = config.getString(ENCODING_KEY); this.messageEncoding = config.getString(ENCODING_MSG); this.morphlineFile = config.getString(MORPHLINE); this.morphlineId = config.getString(MORPHLINE_ID); this.schema = ComponentFactory.create(Schema.class, config.getConfig(SCHEMA_CONFIG), true).getSchema(); }  @Override void configure(Config config); @Override StructType getExpectingSchema(); @Override StructType getProvidingSchema(); @Override Iterable<Row> translate(Row message); @Override String getAlias(); @Override Validations getValidations(); @Override Set<InstantiatedComponent> getComponents(Config config, boolean configure); static final String ENCODING_KEY; static final String ENCODING_MSG; static final String MORPHLINE; static final String MORPHLINE_ID; static final String SCHEMA_CONFIG; }
@Test (expected = RuntimeException.class) public void getSchemaInvalidDataType() throws Exception { Map<String, Object> configMap = Maps.newHashMap(); configMap.put(MorphlineTranslator.ENCODING_KEY, "UTF-8"); configMap.put(MorphlineTranslator.ENCODING_MSG, "UTF-8"); configMap.put(MorphlineTranslator.MORPHLINE, getResourcePath(MORPHLINE_FILE)); configMap.put(MorphlineTranslator.MORPHLINE_ID, "default"); configMap.put(MorphlineTranslator.SCHEMA_CONFIG + "." + ComponentFactory.TYPE_CONFIG_NAME, "flat"); configMap.put(MorphlineTranslator.SCHEMA_CONFIG + "." + FlatSchema.FIELD_NAMES_CONFIG, Lists.newArrayList("bar", "foo")); configMap.put(MorphlineTranslator.SCHEMA_CONFIG + "." + FlatSchema.FIELD_TYPES_CONFIG, Lists.newArrayList("int", "boom")); Config config = ConfigFactory.parseMap(configMap); translator.configure(config); }