Search in sources :

Example 1 with FieldMapping

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);
}
Also used : IFieldLineageMetadataProvider(org.pentaho.metaverse.api.analyzer.kettle.step.IFieldLineageMetadataProvider) IFieldMapping(org.pentaho.metaverse.api.model.kettle.IFieldMapping) FieldMapping(org.pentaho.metaverse.api.model.kettle.FieldMapping) IFieldMapping(org.pentaho.metaverse.api.model.kettle.IFieldMapping) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)1 Test (org.junit.Test)1 IFieldLineageMetadataProvider (org.pentaho.metaverse.api.analyzer.kettle.step.IFieldLineageMetadataProvider)1 FieldMapping (org.pentaho.metaverse.api.model.kettle.FieldMapping)1 IFieldMapping (org.pentaho.metaverse.api.model.kettle.IFieldMapping)1