ProjectionRepository extends EventDispatchingRepository<I, P, S> { @Override @OverridingMethodsMustInvokeSuper public void registerWith(BoundedContext context) throws IllegalStateException { super.registerWith(context); ensureDispatchesEvents(); initCache(context.isMultitenant()); Delivery delivery = ServerEnvironment.instance() .delivery(); initInbox(delivery); initCatchUp(context, delivery); }  @Override @OverridingMethodsMustInvokeSuper void registerWith(BoundedContext context); @OverridingMethodsMustInvokeSuper @Override P create(I id); @Override final void store(P entity); @Override final ImmutableSet<EventClass> messageClasses(); @Override final ImmutableSet<EventClass> domesticEventClasses(); @Override final ImmutableSet<EventClass> externalEventClasses(); @OverridingMethodsMustInvokeSuper @Override final boolean canDispatch(EventEnvelope event); CatchUpId catchUp(Timestamp since, @Nullable Set<I> ids); CatchUpId catchUpAll(Timestamp since); @OverridingMethodsMustInvokeSuper @Override void close();  }
@Test @DisplayName("check that its `Projection` class is subscribed to at least one message") void notRegisterIfSubscribedToNothing() { SensoryDeprivedProjectionRepository repo = new SensoryDeprivedProjectionRepository(); BoundedContext context = BoundedContextBuilder .assumingTests() .build(); assertThrows(IllegalStateException.class, () -> repo.registerWith(context)); }