use of com.torodb.core.transaction.metainf.WrapperMutableMetaDocPart in project torodb by torodb.
the class BatchMetaDocPartTest method setUp.
@Before
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
testChangeConsumer = mock(Consumer.class);
delegateChangeConsumer = mock(Consumer.class);
delegate = new WrapperMutableMetaDocPart(new ImmutableMetaDocPart(tableRefFactory.createRoot(), "docPartId"), delegateChangeConsumer);
docPart = new BatchMetaDocPart(delegate, testChangeConsumer, true);
}
use of com.torodb.core.transaction.metainf.WrapperMutableMetaDocPart in project torodb by torodb.
the class DefaultToBackendFunctionTest method testNoBatchMetaDocPart.
@Test
public void testNoBatchMetaDocPart() {
CollectionData collectionData = mock(CollectionData.class);
DocPartData data1 = mock(DocPartData.class);
given(data1.getMetaDocPart()).willReturn(new WrapperMutableMetaDocPart(new ImmutableMetaDocPart(tableRefFactory.createRoot(), "aDocPartName"), (o) -> {
}));
given(collectionData.orderedDocPartData()).willReturn(Collections.singleton(data1));
//when
try {
fun.apply(collectionData);
//then
fail("An exception was expected when a metadoc part which is not a " + BatchMetaDocPart.class + " is used");
} catch (AssertionError | ClassCastException ex) {
}
}
Aggregations