use of org.hisp.dhis.sms.config.GenericHttpGatewayConfig in project dhis2-core by dhis2.
the class BulkSmsGatewayTest method testAccept.
@Test
void testAccept() {
boolean result = bulkSmsGateway.accept(smsGatewayConfig);
assertTrue(result);
smsGatewayConfig = new GenericHttpGatewayConfig();
result = bulkSmsGateway.accept(smsGatewayConfig);
assertFalse(result);
}
use of org.hisp.dhis.sms.config.GenericHttpGatewayConfig in project dhis2-core by dhis2.
the class V2_34_6__Convert_systemsetting_value_column_from_bytea_to_string method updateSmsConfiguration.
private void updateSmsConfiguration(SmsConfiguration smsConfiguration) {
if (smsConfiguration == null) {
return;
}
List<SmsGatewayConfig> existingGatewayConfigs = smsConfiguration.getGateways();
List<SmsGatewayConfig> updatedGatewayConfigs = new ArrayList<>();
for (SmsGatewayConfig gatewayConfig : existingGatewayConfigs) {
if (gatewayConfig instanceof GenericHttpGetGatewayConfig) {
GenericHttpGatewayConfig newGatewayConfig = convertToNewSmsGenericConfig((GenericHttpGetGatewayConfig) gatewayConfig);
updatedGatewayConfigs.add(newGatewayConfig);
} else {
updatedGatewayConfigs.add(gatewayConfig);
}
}
smsConfiguration.setGateways(updatedGatewayConfigs);
}
Aggregations