Search in sources :

Example 1 with SmsMessageSender

use of org.hisp.dhis.sms.config.SmsMessageSender in project dhis2-core by dhis2.

the class SmsMessageSenderTest method initTest.

@BeforeEach
public void initTest() {
    setUp();
    smsGateways = new ArrayList<>();
    smsGateways.add(bulkSmsGateway);
    smsMessageSender = new SmsMessageSender(gatewayAdministrationService, smsGateways, userSettingService, outboundSmsService);
}
Also used : SmsMessageSender(org.hisp.dhis.sms.config.SmsMessageSender) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with SmsMessageSender

use of org.hisp.dhis.sms.config.SmsMessageSender in project dhis2-core by dhis2.

the class ServiceConfig method defaultOutboundMessageBatchService.

@Bean("org.hisp.dhis.outboundmessage.OutboundMessageService")
public DefaultOutboundMessageBatchService defaultOutboundMessageBatchService(SmsMessageSender smsMessageSender, EmailMessageSender emailMessageSender) {
    Map<DeliveryChannel, MessageSender> channels = new HashMap<>();
    channels.put(DeliveryChannel.SMS, smsMessageSender);
    channels.put(DeliveryChannel.EMAIL, emailMessageSender);
    DefaultOutboundMessageBatchService service = new DefaultOutboundMessageBatchService();
    service.setMessageSenders(channels);
    return service;
}
Also used : DefaultOutboundMessageBatchService(org.hisp.dhis.outboundmessage.DefaultOutboundMessageBatchService) DeliveryChannel(org.hisp.dhis.common.DeliveryChannel) HashMap(java.util.HashMap) MessageSender(org.hisp.dhis.message.MessageSender) SmsMessageSender(org.hisp.dhis.sms.config.SmsMessageSender) EmailMessageSender(org.hisp.dhis.message.EmailMessageSender) Bean(org.springframework.context.annotation.Bean)

Aggregations

SmsMessageSender (org.hisp.dhis.sms.config.SmsMessageSender)2 HashMap (java.util.HashMap)1 DeliveryChannel (org.hisp.dhis.common.DeliveryChannel)1 EmailMessageSender (org.hisp.dhis.message.EmailMessageSender)1 MessageSender (org.hisp.dhis.message.MessageSender)1 DefaultOutboundMessageBatchService (org.hisp.dhis.outboundmessage.DefaultOutboundMessageBatchService)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Bean (org.springframework.context.annotation.Bean)1