Search in sources :

Example 1 with UpdateUserPermissionsHandler

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);
}
Also used : MailSenderStub(org.activityinfo.server.mail.MailSenderStub) PartnerDTO(org.activityinfo.legacy.shared.model.PartnerDTO) TemplateModule(org.activityinfo.server.util.TemplateModule) UpdateUserPermissionsHandler(org.activityinfo.server.command.handler.UpdateUserPermissionsHandler) Before(org.junit.Before)

Aggregations

PartnerDTO (org.activityinfo.legacy.shared.model.PartnerDTO)1 UpdateUserPermissionsHandler (org.activityinfo.server.command.handler.UpdateUserPermissionsHandler)1 MailSenderStub (org.activityinfo.server.mail.MailSenderStub)1 TemplateModule (org.activityinfo.server.util.TemplateModule)1 Before (org.junit.Before)1