use of org.talend.core.model.utils.AbstractDragAndDropServiceHandler in project tdi-studio-se by Talend.
the class GenericDragAndDropHandlerTest method testIsGenericRepositoryValue.
@Test
public void testIsGenericRepositoryValue() {
Connection connection = mock(Connection.class);
AbstractDragAndDropServiceHandler abstractDragAndDropServiceHandler = mock(AbstractDragAndDropServiceHandler.class);
List<ComponentProperties> componentProsList = new ArrayList<>();
boolean isGenericRepositoryValue = abstractDragAndDropServiceHandler.isGenericRepositoryValue(componentProsList, //$NON-NLS-1$
"paramName1");
assertEquals(false, isGenericRepositoryValue);
connection = mock(GenericConnection.class);
GenericDragAndDropHandler genericDragAndDropHandler = mock(GenericDragAndDropHandler.class);
when(genericDragAndDropHandler.canHandle(connection)).thenReturn(true);
//$NON-NLS-1$
isGenericRepositoryValue = genericDragAndDropHandler.isGenericRepositoryValue(null, "paramName2");
assertEquals(false, isGenericRepositoryValue);
// PowerMockito.mockStatic(ComponentsUtils.class);
// ComponentProperties mockComponentProperties = mock(ComponentProperties.class);
// when(ComponentsUtils.getComponentPropertiesFromSerialized(null)).thenReturn(mockComponentProperties);
// List<Property> propertyValues = new ArrayList<Property>();
// Property element = ComponentPropertyFactory.newReturnsProperty();
// propertyValues.add(element);
// when(ComponentsUtils.getAllValuedProperties(mockComponentProperties)).thenReturn(propertyValues);
// isGenericRepositoryValue = genericDragAndDropHandler.isGenericRepositoryValue(connection, "QueryMode");//$NON-NLS-1$
// assertEquals(true, isGenericRepositoryValue);
}
Aggregations