use of com.yahoo.elide.core.datastore.DataStoreTransaction in project elide by yahoo.
the class TransactionWrapperTest method testLoadObjects.
@Test
public void testLoadObjects() throws Exception {
DataStoreTransaction wrapped = mock(DataStoreTransaction.class);
DataStoreTransaction wrapper = new TestTransactionWrapper(wrapped);
DataStoreIterable<Object> expected = mock(DataStoreIterable.class);
when(wrapped.loadObjects(any(), any())).thenReturn(expected);
Iterable<Object> actual = wrapper.loadObjects(null, null);
verify(wrapped, times(1)).loadObjects(any(), any());
assertEquals(expected, actual);
}
use of com.yahoo.elide.core.datastore.DataStoreTransaction in project elide by yahoo.
the class TransactionWrapperTest method testSetAttribute.
@Test
public void testSetAttribute() {
DataStoreTransaction wrapped = mock(DataStoreTransaction.class);
DataStoreTransaction wrapper = new TestTransactionWrapper(wrapped);
wrapper.setAttribute(null, null, null);
verify(wrapped, times(1)).setAttribute(any(), any(), any());
}
use of com.yahoo.elide.core.datastore.DataStoreTransaction in project elide by yahoo.
the class TransactionWrapperTest method testUpdateToManyRelation.
@Test
public void testUpdateToManyRelation() {
DataStoreTransaction wrapped = mock(DataStoreTransaction.class);
DataStoreTransaction wrapper = new TestTransactionWrapper(wrapped);
wrapper.updateToManyRelation(null, null, null, null, null, null);
verify(wrapped, times(1)).updateToManyRelation(any(), any(), any(), any(), any(), any());
}
use of com.yahoo.elide.core.datastore.DataStoreTransaction in project elide by yahoo.
the class TransactionWrapperTest method testGetToOneRelation.
@Test
public void testGetToOneRelation() {
DataStoreTransaction wrapped = mock(DataStoreTransaction.class);
DataStoreTransaction wrapper = new TestTransactionWrapper(wrapped);
when(wrapped.getToOneRelation(any(), any(), any(), any())).thenReturn(1L);
Long actual = wrapper.getToOneRelation(null, null, null, null);
verify(wrapped, times(1)).getToOneRelation(any(), any(), any(), any());
assertEquals(1L, actual);
}
use of com.yahoo.elide.core.datastore.DataStoreTransaction in project elide by yahoo.
the class TransactionWrapperTest method testDelete.
@Test
public void testDelete() {
DataStoreTransaction wrapped = mock(DataStoreTransaction.class);
DataStoreTransaction wrapper = new TestTransactionWrapper(wrapped);
wrapper.delete(null, null);
verify(wrapped, times(1)).delete(any(), any());
}
Aggregations