use of org.activityinfo.server.command.handler.UpdateUserPermissionsHandler in project activityinfo by bedatadriven.
the class UpdateUserPermissionsHandlerTest method setup.
@Before
public void setup() throws TemplateModelException {
NRC = new Partner();
NRC.setId(1);
NRC.setName("NRC");
NRC.setFullName("Norwegian Refugee Council");
db.persist(NRC);
IRC = new Partner();
IRC.setId(2);
IRC.setName("IRC");
IRC.setFullName("International Rescue Committee");
db.persist(IRC);
NRC_DTO = new PartnerDTO(1, "NRC");
TemplateModule templateModule = new TemplateModule();
mailer = new MailSenderStub(templateModule.provideConfiguration(Providers.of(Domain.DEFAULT)));
handler = new UpdateUserPermissionsHandler(db.getDAO(UserDatabaseDAO.class), db.getDAO(PartnerDAO.class), db.getDAO(UserDAO.class), db.getDAO(UserPermissionDAO.class), mailer);
owner = new User();
owner.setId(99);
owner.setName("Alex");
owner.setEmail("alex@bedatadriven.com");
db.persist(owner);
Database udb = new Database(1, "PEAR");
udb.setOwner(owner);
db.persist(udb);
}
Aggregations