use of keywhiz.test.ServiceContext in project keywhiz by square.
the class BackfillOwnershipCommandTest method backfill.
private int backfill() {
ServiceContext context = ServiceContext.create();
Namespace namespace = new Namespace(Collections.emptyMap());
return new BackfillOwnershipCommand().execute(context.getBootstrap(), namespace, context.getConfig());
}
use of keywhiz.test.ServiceContext in project keywhiz by square.
the class ServiceDataSourceModuleTest method injectsDataSources.
@Test
public void injectsDataSources() {
class Holder {
@Inject
ManagedDataSource readWrite;
@Inject
@Readonly
ManagedDataSource readonly;
}
Holder holder = new Holder();
ServiceContext context = ServiceContext.create();
Guice.createInjector(new ContextModule(context.getConfig(), context.getEnvironment()), new ServiceDataSourceModule()).injectMembers(holder);
assertNotNull(holder.readWrite);
assertNotNull(holder.readonly);
}
use of keywhiz.test.ServiceContext in project keywhiz by square.
the class AddUserCommandTest method injectsUserDAO.
@Test
public void injectsUserDAO() {
ServiceContext context = ServiceContext.create();
assertNotNull(AddUserCommand.getUserDAO(context.getBootstrap(), context.getConfig()));
}
use of keywhiz.test.ServiceContext in project keywhiz by square.
the class KeywhizServiceTest method ensuresInjectorIsCreated.
@Test
public void ensuresInjectorIsCreated() {
ServiceContext context = ServiceContext.create();
KeywhizService service = context.getService();
assertNull(service.getInjector());
service.ensureInjectorCreated(context.getConfig(), context.getEnvironment());
assertNotNull(service.getInjector());
}
use of keywhiz.test.ServiceContext in project keywhiz by square.
the class DropDeletedSecretsCommandTest method injectsDao.
@Test
public void injectsDao() {
ServiceContext context = ServiceContext.create();
assertNotNull(DropDeletedSecretsCommand.getSecretDAO(context.getBootstrap(), context.getConfig()));
}
Aggregations