use of io.atlasmap.spi.AtlasInternalSession in project atlasmap by atlasmap.
the class BaseDocumentWriterTest method write.
protected void write(Field field) throws AtlasException {
AtlasInternalSession session = mock(AtlasInternalSession.class);
when(session.head()).thenReturn(mock(Head.class));
when(session.head().getTargetField()).thenReturn(field);
writer.write(session);
}
use of io.atlasmap.spi.AtlasInternalSession in project atlasmap by atlasmap.
the class BaseDocumentWriterTest method reset.
@Before
public void reset() {
classLoader = Thread.currentThread().getContextClassLoader();
writer = new DocumentJavaFieldWriter(conversionService);
writer.setTargetValueConverter(new TargetValueConverter(classLoader, conversionService) {
public Object convert(AtlasInternalSession session, LookupTable lookupTable, Field sourceField, Object parentObject, Field targetField) throws AtlasException {
return targetField.getValue();
}
});
field = null;
segmentContexts = new LinkedList<>();
targetTestClassInstance = new TargetTestClass();
targetTestClassInstance.setContact(new TargetContact());
targetTestClassInstance.setAddress(new TargetAddress());
targetOrderListInstance = new TestListOrders();
targetOrderListInstance.setOrders(new LinkedList<>());
targetOrderListInstance.getOrders().add(new TargetOrder());
targetOrderListInstance.getOrders().add(new TargetOrder());
targetTestClassInstance.setListOrders(targetOrderListInstance);
targetOrderArrayInstance = new TargetOrderArray();
targetOrderArrayInstance.setOrders(new BaseOrder[2]);
targetOrderArrayInstance.getOrders()[0] = new TargetOrder();
targetOrderArrayInstance.getOrders()[1] = new TargetOrder();
targetTestClassInstance.setOrderArray(targetOrderArrayInstance);
}
Aggregations