use of org.pentaho.metaverse.api.model.kettle.FieldMapping in project pentaho-metaverse by pentaho.
the class AbstractStepMetaJsonSerializerTest method testWriteFieldMappings.
@Test
public void testWriteFieldMappings() throws Exception {
Set<IFieldMapping> mappings = new HashSet<IFieldMapping>();
FieldMapping fieldMapping1 = new FieldMapping("full name", "first name");
FieldMapping fieldMapping2 = new FieldMapping("full name", "last name");
mappings.add(fieldMapping1);
mappings.add(fieldMapping2);
IFieldLineageMetadataProvider mapper = mock(IFieldLineageMetadataProvider.class);
AbstractStepMetaJsonSerializer spy = spy(serializer);
when(spy.getFieldLineageMetadataProvider(spyMeta)).thenReturn(mapper);
when(mapper.getFieldMappings(spyMeta)).thenReturn(mappings);
spy.writeFieldMappings(spyMeta, json, provider);
verify(json).writeObject(fieldMapping1);
verify(json).writeObject(fieldMapping2);
}
Aggregations