### Question:
ArchetypeServiceImpl implements ArchetypeService { Repository createArchetypeRepository(final GAV templateGav, final String repositoryUri) { final OrganizationalUnit archetypesOU = resolveOU(); if (archetypesOU != null) { final Repository repository = repositoryService.createRepository(archetypesOU, GitRepository.SCHEME.toString(), makeRepositoryAlias(templateGav.toString()), createRepositoryConfig(repositoryUri)); cleanUpOrigin(repository); return repository; } else { throw new IllegalStateException("Cannot create an archetype when there is no archetype space available."); } } ArchetypeServiceImpl(); @Inject  ArchetypeServiceImpl(final @Named("ioStrategy") IOService ioService,
                                final RepositoryService repositoryService,
                                final OrganizationalUnitService ouService,
                                final Event<ArchetypeListUpdatedEvent> archetypeListUpdatedEvent,
                                final ArchetypeConfigStorage archetypeConfigStorage,
                                final PathUtil pathUtil,
                                final ArchetypePreferencesManager archetypePreferencesManager,
                                final KieModuleService moduleService,
                                final POMService pomService); void onNewOrganizationalUnitEvent(final @Observes NewOrganizationalUnitEvent newOrganizationalUnitEvent); @Override void add(final GAV archetypeGav); @Override void add(final GAV archetypeGav,
                    final GAV templateGav); @Override PaginatedArchetypeList list(final Integer page,
                                       final Integer pageSize,
                                       final String filter); @Override PaginatedArchetypeList list(final Integer page,
                                       final Integer pageSize,
                                       final String filter,
                                       final ArchetypeStatus status); @Override void delete(final String alias); @Override void validateAll(); @Override void validate(final String alias); @Override Repository getTemplateRepository(final String alias); @Override Optional<Repository> getBaseKieTemplateRepository(); @Override Optional<Archetype> getBaseKieArchetype();  }### Answer:
@Test(expected = IllegalStateException.class) public void createArchetypeRepositoryWhenOrgUnitIsNotAvailableTest() { mockArchetypesOrgUnitNotAvailable(); service.createArchetypeRepository(eq(createTemplateGav()), anyString()); }