use of io.georocket.util.io.BufferWriteStream in project georocket by georocket.
the class AllSameStrategyTest method mergeFail.
/**
* Test if the merge method fails if it is called with an unexpected chunk
* @param context the test context
*/
@Test
public void mergeFail(TestContext context) {
XMLChunkMeta cm2 = new XMLChunkMeta(Arrays.asList(new XMLStartElement("other")), 10, 20);
Async async = context.async();
MergeStrategy strategy = new AllSameStrategy();
BufferWriteStream bws = new BufferWriteStream();
strategy.init(cm).flatMap(v -> strategy.merge(new DelegateChunkReadStream(chunk2), cm2, bws)).subscribe(v -> context.fail(), err -> {
context.assertTrue(err instanceof IllegalArgumentException);
async.complete();
});
}
Aggregations