Search in sources :

Example 1 with TemplateModule

use of org.activityinfo.server.util.TemplateModule 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)

Example 2 with TemplateModule

use of org.activityinfo.server.util.TemplateModule in project activityinfo by bedatadriven.

the class ViewTestCase method setUpTemplateConfig.

@BeforeClass
public static void setUpTemplateConfig() throws TemplateModelException {
    TemplateModule module = new TemplateModule();
    templateCfg = module.provideConfiguration(Providers.of(Domain.DEFAULT));
}
Also used : TemplateModule(org.activityinfo.server.util.TemplateModule) BeforeClass(org.junit.BeforeClass)

Example 3 with TemplateModule

use of org.activityinfo.server.util.TemplateModule in project activityinfo by bedatadriven.

the class PostmarkMailSenderTest method setUp.

@Before
public void setUp() throws TemplateModelException {
    Properties properties = new Properties();
    properties.setProperty(PostmarkMailSender.POSTMARK_API_KEY, "POSTMARK_API_TEST");
    DeploymentConfiguration config = new DeploymentConfiguration(properties);
    TemplateModule templateModule = new TemplateModule();
    sender = new PostmarkMailSender(config, templateModule.provideConfiguration(Providers.of(Domain.DEFAULT)));
}
Also used : TemplateModule(org.activityinfo.server.util.TemplateModule) Properties(java.util.Properties) DeploymentConfiguration(org.activityinfo.server.DeploymentConfiguration) Before(org.junit.Before)

Aggregations

TemplateModule (org.activityinfo.server.util.TemplateModule)3 Before (org.junit.Before)2 Properties (java.util.Properties)1 PartnerDTO (org.activityinfo.legacy.shared.model.PartnerDTO)1 DeploymentConfiguration (org.activityinfo.server.DeploymentConfiguration)1 UpdateUserPermissionsHandler (org.activityinfo.server.command.handler.UpdateUserPermissionsHandler)1 MailSenderStub (org.activityinfo.server.mail.MailSenderStub)1 BeforeClass (org.junit.BeforeClass)1