use of com.baremaps.osm.repository.SaveBlockConsumer in project baremaps by baremaps.
the class SaveBlockConsumerTest method test.
@Test
@Tag("integration")
void test() throws BlobStoreException, RepositoryException, URISyntaxException {
// Import data
SaveBlockConsumer dataImporter = new SaveBlockConsumer(headerRepository, nodeRepository, tableRepository, relationRepository);
InputStream inputStream = new ResourceBlobStore().get(new URI("res://simple/data.osm.pbf")).getInputStream();
new OsmPbfParser().blocks(inputStream).forEach(dataImporter);
// Check node importation
assertNull(nodeRepository.get(0l));
assertNotNull(nodeRepository.get(1l));
assertNotNull(nodeRepository.get(2l));
assertNotNull(nodeRepository.get(3l));
assertNull(nodeRepository.get(4l));
// Check way importation
assertNull(tableRepository.get(0l));
assertNotNull(tableRepository.get(1l));
assertNull(tableRepository.get(2l));
// Check relation importation
assertNull(relationRepository.get(0l));
assertNotNull(relationRepository.get(1l));
assertNull(relationRepository.get(2l));
}
Aggregations