use of org.pentaho.di.shared.SharedObjectInterface in project pentaho-kettle by pentaho.
the class SpoonSharedObjectDelegateTest method mockObject.
private SharedObjectInterface mockObject(String name) {
SharedObjectInterface obj = mock(SharedObjectInterface.class);
when(obj.getName()).thenReturn(name);
return obj;
}
use of org.pentaho.di.shared.SharedObjectInterface in project pentaho-kettle by pentaho.
the class DialogUtilsTest method objectWithTheSameNameExists_false_if_not_exist.
@Test
public void objectWithTheSameNameExists_false_if_not_exist() {
SharedObjectInterface sharedObject = mock(SharedObjectInterface.class);
when(sharedObject.getName()).thenReturn("NEW_TEST_OBJECT");
assertFalse(objectWithTheSameNameExists(sharedObject, createTestScope("TEST_OBJECT")));
}
use of org.pentaho.di.shared.SharedObjectInterface in project pentaho-kettle by pentaho.
the class DialogUtilsTest method objectWithTheSameNameExists_false_if_same_object.
@Test
public void objectWithTheSameNameExists_false_if_same_object() {
SharedObjectInterface sharedObject = mock(SharedObjectInterface.class);
when(sharedObject.getName()).thenReturn("TEST_OBJECT");
assertFalse(objectWithTheSameNameExists(sharedObject, Collections.singleton(sharedObject)));
}
use of org.pentaho.di.shared.SharedObjectInterface in project pentaho-kettle by pentaho.
the class DialogUtilsTest method objectWithTheSameNameExists_true_if_exists.
@Test
public void objectWithTheSameNameExists_true_if_exists() {
SharedObjectInterface sharedObject = mock(SharedObjectInterface.class);
when(sharedObject.getName()).thenReturn("TEST_OBJECT");
assertTrue(objectWithTheSameNameExists(sharedObject, createTestScope("TEST_OBJECT")));
}
use of org.pentaho.di.shared.SharedObjectInterface in project pentaho-kettle by pentaho.
the class DialogUtilsTest method createTestScope.
private static Collection<SharedObjectInterface> createTestScope(String objectName) {
SharedObjectInterface sharedObject = mock(SharedObjectInterface.class);
when(sharedObject.getName()).thenReturn(objectName);
return Collections.singleton(sharedObject);
}
Aggregations