@Test(expected = NullPointerException.class) public void failsWhenNotEnoughArgs() { HollowProducer backingProducer = HollowProducer.withPublisher(blobStore) .withBlobStager(new HollowInMemoryBlobStager()) .build(); //No AnnouncementWatcher, BlobRetriever and DataModel to restore HollowIncrementalProducer incrementalProducer = HollowIncrementalProducer.withProducer(backingProducer) .build(); incrementalProducer.restoreFromLastState(); }
@Test(expected = RuntimeException.class) public void failsWhenLastStateIsNotAvailable() { HollowProducer backingProducer = HollowProducer.withPublisher(blobStore) .withBlobStager(new HollowInMemoryBlobStager()) .build(); HollowIncrementalProducer incrementalProducer = HollowIncrementalProducer.withProducer(backingProducer) .withBlobRetriever(blobStore) .withAnnouncementWatcher(new FakeAnnouncementWatcher(0)) .withDataModel(TypeA.class, TypeB.class) .build(); incrementalProducer.restoreFromLastState(); }
incrementalProducer.restoreFromLastState();