use of com.google.gerrit.testing.InMemoryModule in project gerrit by GerritCodeReview.
the class LabelNormalizerTest method setUpInjector.
@Before
public void setUpInjector() throws Exception {
Injector injector = Guice.createInjector(new InMemoryModule());
injector.injectMembers(this);
lifecycle = new LifecycleManager();
lifecycle.add(injector);
lifecycle.start();
schemaCreator.create();
userId = accountManager.authenticate(authRequestFactory.createForUser("user")).getAccountId();
user = userFactory.create(userId);
requestContext.setContext(() -> user);
configureProject();
setUpChange();
}
use of com.google.gerrit.testing.InMemoryModule in project gerrit by GerritCodeReview.
the class GerritPublicKeyCheckerTest method setUpInjector.
@Before
public void setUpInjector() throws Exception {
Config cfg = InMemoryModule.newDefaultConfig();
cfg.setInt("receive", null, "maxTrustDepth", 2);
cfg.setStringList("receive", null, "trustedKey", ImmutableList.of(Fingerprint.toString(keyB().getPublicKey().getFingerprint()), Fingerprint.toString(keyD().getPublicKey().getFingerprint())));
Injector injector = Guice.createInjector(new InMemoryModule(cfg));
lifecycle = new LifecycleManager();
lifecycle.add(injector);
injector.injectMembers(this);
lifecycle.start();
schemaCreator.create();
userId = accountManager.authenticate(authRequestFactory.createForUser("user")).getAccountId();
// Note: does not match any key in TestKeys.
accountsUpdateProvider.get().update("Set Preferred Email", userId, u -> u.setPreferredEmail("user@example.com"));
user = reloadUser();
requestContext.setContext(() -> user);
storeRepo = new InMemoryRepository(new DfsRepositoryDescription("repo"));
store = new PublicKeyStore(storeRepo);
}
use of com.google.gerrit.testing.InMemoryModule in project gerrit by GerritCodeReview.
the class LuceneQueryProjectsTest method createInjector.
@Override
protected Injector createInjector() {
Config luceneConfig = new Config(config);
InMemoryModule.setDefaults(luceneConfig);
return Guice.createInjector(new InMemoryModule(luceneConfig));
}
use of com.google.gerrit.testing.InMemoryModule in project gerrit by GerritCodeReview.
the class SchemaCreatorImplTest method setUp.
@Before
public void setUp() throws Exception {
new InMemoryModule().inject(this);
schemaCreator.create();
}
use of com.google.gerrit.testing.InMemoryModule in project gerrit by GerritCodeReview.
the class OAuthRealmTest method setUpInjector.
@Before
public void setUpInjector() throws Exception {
Injector injector = Guice.createInjector(new InMemoryModule());
injector.injectMembers(this);
}
Aggregations