BoundedContext implements Closeable, Logging { protected final void register(Repository<?, ?> repository) { checkNotNull(repository); registerIfAware(repository); guard.register(repository); repository.onRegistered(); } @SuppressWarnings("ThisEscapedInObjectConstruction") // to inject dependencies. @Internal protected  BoundedContext(BoundedContextBuilder builder); static BoundedContextBuilder singleTenant(String name); static BoundedContextBuilder multitenant(String name); Set<TypeName> stateTypes(Visibility visibility); Set<TypeName> stateTypes(); boolean hasEntitiesOfType(Class<? extends Entity<?, ?>> entityClass); boolean hasEntitiesWithState(Class<? extends EntityState> stateClass); CommandBus commandBus(); EventBus eventBus(); ImportBus importBus(); Stand stand(); BoundedContextName name(); ContextSpec spec(); boolean isMultitenant(); @Internal abstract SystemClient systemClient(); @Override void close(); @Override boolean isOpen(); @Override String toString(); @Internal final InternalAccess internalAccess();  }
@Test @DisplayName("assign storage during registration if repository does not have one") void setStorageOnRegister() { Repository<ProjectId, ProjectAggregate> repository = DefaultRepository.of(ProjectAggregate.class); context.register(repository); assertTrue(repository.storageAssigned()); }