use of cz.o2.proxima.direct.core.DataAccessorFactory in project proxima-platform by O2-Czech-Republic.
the class GCloudStorageAccessorTest method testReaderAsFactorySerializable.
@Test
public void testReaderAsFactorySerializable() throws IOException, ClassNotFoundException {
DataAccessorFactory descriptor = new GCloudStorageDescriptor();
DataAccessor accessor = descriptor.createAccessor(direct, TestUtils.createTestFamily(entity, URI.create("gs://bucket")));
Optional<BatchLogReader> reader = accessor.getBatchLogReader(direct.getContext());
assertTrue(reader.isPresent());
byte[] bytes = TestUtils.serializeObject(reader.get().asFactory());
BatchLogReader.Factory<?> factory = TestUtils.deserializeObject(bytes);
assertEquals(accessor.getUri(), ((GCloudLogReader) factory.apply(repo)).getAccessor().getUri());
}
Aggregations