Skip to content

Commit

Permalink
Add unicode data type support for notification templates
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanasbg committed Nov 7, 2024
1 parent 91d021b commit d01357e
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ private I18nMgtConstants() {}

public static final String NOTIFICATION_TEMPLATES_STORAGE_CONFIG = "DataStorageType.NotificationTemplates";
public static final String NOTIFICATION_TEMPLATES_LEGACY_TENANTS = "NotificationTemplates.LegacyTenants.Tenant";
public static final String NOTIFICATION_TEMPLATES_IS_UNICODE_DATA_TYPE = "NotificationTemplates.IsUnicodeDataType";

public static final String SERVICE_PROPERTY_KEY_SERVICE_NAME = "service.name";
public static final String SERVICE_PROPERTY_VAL_EMAIL_TEMPLATE_MANAGER = "EmailTemplateManager";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,27 @@ public class SQLConstants {
"DELETE FROM IDN_NOTIFICATION_ORG_TEMPLATE WHERE TYPE_ID = (" + GET_NOTIFICATION_TYPE_ID_SQL +
") AND TENANT_ID = :TENANT_ID;";

// sql constants for org notification template with unicode datatypes
public static final String INSERT_ORG_NOTIFICATION_TEMPLATE_SQL_UNICODE =
"INSERT INTO IDN_NOTIFICATION_ORG_TEMPLATE " +
"(TEMPLATE_KEY, LOCALE, NSUBJECT, NBODY, NFOOTER, CONTENT_TYPE, TYPE_ID, TENANT_ID) " +
"VALUES (:TEMPLATE_KEY;, :LOCALE;, :SUBJECT;, :BODY;, :FOOTER;, :CONTENT_TYPE;, (" +
GET_NOTIFICATION_TYPE_ID_SQL + "), :TENANT_ID;)";
public static final String GET_ORG_NOTIFICATION_TEMPLATE_SQL_UNICODE =
"SELECT NSUBJECT AS SUBJECT, NBODY AS BODY, NFOOTER AS FOOTER, CONTENT_TYPE" +
"FROM IDN_NOTIFICATION_ORG_TEMPLATE " +
"WHERE TEMPLATE_KEY = :TEMPLATE_KEY; AND TYPE_ID = (" + GET_NOTIFICATION_TYPE_ID_SQL +
") AND TENANT_ID = :TENANT_ID;";
public static final String LIST_ORG_NOTIFICATION_TEMPLATES_BY_TYPE_SQL_UNICODE =
"SELECT NSUBJECT AS SUBJECT, NBODY AS BODY, NFOOTER AS FOOTER, CONTENT_TYPE, LOCALE " +
"FROM IDN_NOTIFICATION_ORG_TEMPLATE " +
"WHERE TYPE_ID = (" + GET_NOTIFICATION_TYPE_ID_SQL + ") AND TENANT_ID = :TENANT_ID;";
public static final String UPDATE_ORG_NOTIFICATION_TEMPLATE_SQL_UNICODE =
"UPDATE IDN_NOTIFICATION_ORG_TEMPLATE " +
"SET NSUBJECT = :SUBJECT;, NBODY = :BODY;, NFOOTER = :FOOTER;, CONTENT_TYPE = :CONTENT_TYPE; " +
"WHERE TEMPLATE_KEY = :TEMPLATE_KEY; AND TYPE_ID = (" + GET_NOTIFICATION_TYPE_ID_SQL +
") AND TENANT_ID = :TENANT_ID;";

// sql constants for app notification template
public static final String INSERT_APP_NOTIFICATION_TEMPLATE_SQL =
"INSERT INTO IDN_NOTIFICATION_APP_TEMPLATE " +
Expand Down Expand Up @@ -100,4 +121,26 @@ public class SQLConstants {
public static final String DELETE_ALL_APP_NOTIFICATION_TEMPLATES_BY_TYPE_SQL =
"DELETE FROM IDN_NOTIFICATION_APP_TEMPLATE WHERE TYPE_ID = (" + GET_NOTIFICATION_TYPE_ID_SQL +
") AND TENANT_ID = :TENANT_ID;";

// sql constants for org notification template with unicode datatypes
public static final String INSERT_APP_NOTIFICATION_TEMPLATE_SQL_UNICODE =
"INSERT INTO IDN_NOTIFICATION_APP_TEMPLATE " +
"(TEMPLATE_KEY, LOCALE, NSUBJECT, NBODY, NFOOTER, CONTENT_TYPE, TYPE_ID, APP_ID, TENANT_ID) " +
"VALUES (:TEMPLATE_KEY;, :LOCALE;, :SUBJECT;, :BODY;, :FOOTER;, :CONTENT_TYPE;, (" +
GET_NOTIFICATION_TYPE_ID_SQL + "), :APP_ID;, :TENANT_ID;)";
public static final String GET_APP_NOTIFICATION_TEMPLATE_SQL_UNICODE =
"SELECT NSUBJECT AS SUBJECT, NBODY AS BODY, NFOOTER AS FOOTER, CONTENT_TYPE " +
"FROM IDN_NOTIFICATION_APP_TEMPLATE " +
"WHERE TEMPLATE_KEY = :TEMPLATE_KEY; AND TYPE_ID = (" + GET_NOTIFICATION_TYPE_ID_SQL +
") AND APP_ID = :APP_ID; AND TENANT_ID = :TENANT_ID;";
public static final String LIST_APP_NOTIFICATION_TEMPLATES_BY_APP_SQL_UNICODE =
"SELECT NSUBJECT AS SUBJECT, NBODY AS BODY, NFOOTER AS FOOTER, CONTENT_TYPE, LOCALE " +
"FROM IDN_NOTIFICATION_APP_TEMPLATE " +
"WHERE TYPE_ID = (" + GET_NOTIFICATION_TYPE_ID_SQL +
") AND APP_ID = :APP_ID; AND TENANT_ID = :TENANT_ID;";
public static final String UPDATE_APP_NOTIFICATION_TEMPLATE_SQL_UNICODE =
"UPDATE IDN_NOTIFICATION_APP_TEMPLATE " +
"SET NSUBJECT = :SUBJECT;, NBODY = :BODY;, NFOOTER = :FOOTER;, CONTENT_TYPE = :CONTENT_TYPE; " +
"WHERE TEMPLATE_KEY = :TEMPLATE_KEY; AND TYPE_ID = (" + GET_NOTIFICATION_TYPE_ID_SQL +
") AND APP_ID = :APP_ID; AND TENANT_ID = :TENANT_ID;";
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class I18nMgtDataHolder{
private List<NotificationTemplate> defaultEmailTemplates = new ArrayList<>();
private List<NotificationTemplate> defaultSMSTemplates = new ArrayList<>();
private List<String> legacyTenants = new ArrayList<>();
private boolean isUnicodeDataType;

private static I18nMgtDataHolder instance = new I18nMgtDataHolder();

Expand Down Expand Up @@ -160,4 +161,24 @@ public List<String> getLegacyTenants() {

return legacyTenants;
}

/**
* Set the unicode data type status.
*
* @param isUnicodeDataType Unicode data type status.
*/
public void setUnicodeDataType(boolean isUnicodeDataType) {

this.isUnicodeDataType = isUnicodeDataType;
}

/**
* Get the unicode data type status.
*
* @return Unicode data type status.
*/
public boolean isUnicodeDataType() {

return isUnicodeDataType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;

import static org.wso2.carbon.email.mgt.constants.I18nMgtConstants.NOTIFICATION_TEMPLATES_IS_UNICODE_DATA_TYPE;
import static org.wso2.carbon.email.mgt.constants.I18nMgtConstants.NOTIFICATION_TEMPLATES_LEGACY_TENANTS;
import static org.wso2.carbon.email.mgt.constants.I18nMgtConstants.SERVICE_PROPERTY_KEY_SERVICE_NAME;
import static org.wso2.carbon.email.mgt.constants.I18nMgtConstants.SERVICE_PROPERTY_VAL_EMAIL_TEMPLATE_MANAGER;
Expand Down Expand Up @@ -103,6 +104,9 @@ protected void activate(ComponentContext context) {
List<String> legacyTenants = IdentityUtil.getPropertyAsList(NOTIFICATION_TEMPLATES_LEGACY_TENANTS);
I18nMgtDataHolder.getInstance().setLegacyTenants(legacyTenants);

String isUnicodeDataTypeProp = IdentityUtil.getProperty(NOTIFICATION_TEMPLATES_IS_UNICODE_DATA_TYPE);
I18nMgtDataHolder.getInstance().setUnicodeDataType(Boolean.parseBoolean(isUnicodeDataTypeProp));

// Register Email Mgt Service as an OSGi service.
EmailTemplateManagerImpl emailTemplateManager = new EmailTemplateManagerImpl();
ServiceRegistration emailTemplateSR = bundleCtx.registerService(EmailTemplateManager.class.getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.wso2.carbon.database.utils.jdbc.NamedJdbcTemplate;
import org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException;
import org.wso2.carbon.email.mgt.internal.I18nMgtDataHolder;
import org.wso2.carbon.identity.core.util.JdbcUtils;
import org.wso2.carbon.identity.governance.exceptions.notiification.NotificationTemplateManagerServerException;
import org.wso2.carbon.identity.governance.model.NotificationTemplate;
Expand All @@ -42,17 +43,23 @@
import static org.wso2.carbon.email.mgt.constants.SQLConstants.DELETE_APP_NOTIFICATION_TEMPLATES_BY_TYPE_SQL;
import static org.wso2.carbon.email.mgt.constants.SQLConstants.DELETE_APP_NOTIFICATION_TEMPLATE_SQL;
import static org.wso2.carbon.email.mgt.constants.SQLConstants.GET_APP_NOTIFICATION_TEMPLATE_SQL;
import static org.wso2.carbon.email.mgt.constants.SQLConstants.GET_APP_NOTIFICATION_TEMPLATE_SQL_UNICODE;
import static org.wso2.carbon.email.mgt.constants.SQLConstants.GET_NOTIFICATION_TYPE_ID_SQL;
import static org.wso2.carbon.email.mgt.constants.SQLConstants.INSERT_APP_NOTIFICATION_TEMPLATE_SQL;
import static org.wso2.carbon.email.mgt.constants.SQLConstants.INSERT_APP_NOTIFICATION_TEMPLATE_SQL_UNICODE;
import static org.wso2.carbon.email.mgt.constants.SQLConstants.IS_APP_NOTIFICATION_TEMPLATE_EXISTS_SQL;
import static org.wso2.carbon.email.mgt.constants.SQLConstants.LIST_APP_NOTIFICATION_TEMPLATES_BY_APP_SQL;
import static org.wso2.carbon.email.mgt.constants.SQLConstants.LIST_APP_NOTIFICATION_TEMPLATES_BY_APP_SQL_UNICODE;
import static org.wso2.carbon.email.mgt.constants.SQLConstants.UPDATE_APP_NOTIFICATION_TEMPLATE_SQL;
import static org.wso2.carbon.email.mgt.constants.SQLConstants.UPDATE_APP_NOTIFICATION_TEMPLATE_SQL_UNICODE;

/**
* This class is to perform CRUD operations for Application NotificationTemplates.
*/
public class AppNotificationTemplateDAO {

private boolean isUnicodeDataType = I18nMgtDataHolder.getInstance().isUnicodeDataType();

public void addNotificationTemplate(NotificationTemplate notificationTemplate, String applicationUuid, int tenantId)
throws NotificationTemplateManagerServerException {

Expand All @@ -62,12 +69,20 @@ public void addNotificationTemplate(NotificationTemplate notificationTemplate, S

NamedJdbcTemplate namedJdbcTemplate = JdbcUtils.getNewNamedJdbcTemplate();
try {
namedJdbcTemplate.executeInsert(INSERT_APP_NOTIFICATION_TEMPLATE_SQL, (preparedStatement -> {
String insertAppNotificationTemplateSql = isUnicodeDataType ? INSERT_APP_NOTIFICATION_TEMPLATE_SQL_UNICODE :
INSERT_APP_NOTIFICATION_TEMPLATE_SQL;
namedJdbcTemplate.executeInsert(insertAppNotificationTemplateSql, (preparedStatement -> {

Check warning on line 74 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L73-L74

Added lines #L73 - L74 were not covered by tests
preparedStatement.setString(TEMPLATE_KEY, locale.toLowerCase());
preparedStatement.setString(LOCALE, locale);
preparedStatement.setString(SUBJECT, notificationTemplate.getSubject());
preparedStatement.setString(BODY, notificationTemplate.getBody());
preparedStatement.setString(FOOTER, notificationTemplate.getFooter());
if (isUnicodeDataType) {
preparedStatement.setNString(SUBJECT, notificationTemplate.getSubject());
preparedStatement.setNString(BODY, notificationTemplate.getBody());
preparedStatement.setNString(FOOTER, notificationTemplate.getFooter());

Check warning on line 80 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L78-L80

Added lines #L78 - L80 were not covered by tests
} else {
preparedStatement.setString(SUBJECT, notificationTemplate.getSubject());
preparedStatement.setString(BODY, notificationTemplate.getBody());
preparedStatement.setString(FOOTER, notificationTemplate.getFooter());

Check warning on line 84 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L82-L84

Added lines #L82 - L84 were not covered by tests
}
preparedStatement.setString(CONTENT_TYPE, notificationTemplate.getContentType());
preparedStatement.setString(TYPE_KEY, displayName.toLowerCase());
preparedStatement.setString(CHANNEL, channelName);
Expand All @@ -91,12 +106,20 @@ public NotificationTemplate getNotificationTemplate(String locale, String templa
NotificationTemplate notificationTemplate;

try {
notificationTemplate = namedJdbcTemplate.fetchSingleRecord(GET_APP_NOTIFICATION_TEMPLATE_SQL,
String getAppNotificationTemplateSql =
isUnicodeDataType ? GET_APP_NOTIFICATION_TEMPLATE_SQL_UNICODE : GET_APP_NOTIFICATION_TEMPLATE_SQL;
notificationTemplate = namedJdbcTemplate.fetchSingleRecord(getAppNotificationTemplateSql,

Check warning on line 111 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L111

Added line #L111 was not covered by tests
(resultSet, rowNumber) -> {
NotificationTemplate notificationTemplateResult = new NotificationTemplate();
notificationTemplateResult.setSubject(resultSet.getString(SUBJECT));
notificationTemplateResult.setBody(resultSet.getString(BODY));
notificationTemplateResult.setFooter(resultSet.getString(FOOTER));
if (isUnicodeDataType) {
notificationTemplateResult.setSubject(resultSet.getNString(SUBJECT));
notificationTemplateResult.setBody(resultSet.getNString(BODY));
notificationTemplateResult.setFooter(resultSet.getNString(FOOTER));

Check warning on line 117 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L115-L117

Added lines #L115 - L117 were not covered by tests
} else {
notificationTemplateResult.setSubject(resultSet.getString(SUBJECT));
notificationTemplateResult.setBody(resultSet.getString(BODY));
notificationTemplateResult.setFooter(resultSet.getString(FOOTER));

Check warning on line 121 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L119-L121

Added lines #L119 - L121 were not covered by tests
}
notificationTemplateResult.setContentType(resultSet.getString(CONTENT_TYPE));
notificationTemplateResult.setLocale(locale);
notificationTemplateResult.setType(templateType);
Expand Down Expand Up @@ -173,12 +196,21 @@ public List<NotificationTemplate> listNotificationTemplates(String templateType,
List<NotificationTemplate> notificationTemplates;

try {
notificationTemplates = namedJdbcTemplate.executeQuery(LIST_APP_NOTIFICATION_TEMPLATES_BY_APP_SQL,
String listAppNotificationTemplatesByAppSql =
isUnicodeDataType ? LIST_APP_NOTIFICATION_TEMPLATES_BY_APP_SQL_UNICODE :
LIST_APP_NOTIFICATION_TEMPLATES_BY_APP_SQL;
notificationTemplates = namedJdbcTemplate.executeQuery(listAppNotificationTemplatesByAppSql,

Check warning on line 202 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L201-L202

Added lines #L201 - L202 were not covered by tests
(resultSet, rowNumber) -> {
NotificationTemplate notificationTemplateResult = new NotificationTemplate();
notificationTemplateResult.setSubject(resultSet.getString(SUBJECT));
notificationTemplateResult.setBody(resultSet.getString(BODY));
notificationTemplateResult.setFooter(resultSet.getString(FOOTER));
if (isUnicodeDataType) {
notificationTemplateResult.setSubject(resultSet.getNString(SUBJECT));
notificationTemplateResult.setBody(resultSet.getNString(BODY));
notificationTemplateResult.setFooter(resultSet.getNString(FOOTER));

Check warning on line 208 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L206-L208

Added lines #L206 - L208 were not covered by tests
} else {
notificationTemplateResult.setSubject(resultSet.getString(SUBJECT));
notificationTemplateResult.setBody(resultSet.getString(BODY));
notificationTemplateResult.setFooter(resultSet.getString(FOOTER));

Check warning on line 212 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L210-L212

Added lines #L210 - L212 were not covered by tests
}
notificationTemplateResult.setContentType(resultSet.getString(CONTENT_TYPE));
notificationTemplateResult.setLocale(resultSet.getString(LOCALE));
notificationTemplateResult.setType(templateType.toLowerCase());
Expand Down Expand Up @@ -211,19 +243,26 @@ public void updateNotificationTemplate(NotificationTemplate notificationTemplate

NamedJdbcTemplate namedJdbcTemplate = JdbcUtils.getNewNamedJdbcTemplate();
try {
namedJdbcTemplate.executeUpdate(UPDATE_APP_NOTIFICATION_TEMPLATE_SQL,
preparedStatement -> {
preparedStatement.setString(SUBJECT, notificationTemplate.getSubject());
preparedStatement.setString(BODY, notificationTemplate.getBody());
preparedStatement.setString(FOOTER, notificationTemplate.getFooter());
preparedStatement.setString(CONTENT_TYPE, notificationTemplate.getContentType());
preparedStatement.setString(TEMPLATE_KEY, locale.toLowerCase());
preparedStatement.setString(TYPE_KEY, displayName.toLowerCase());
preparedStatement.setString(CHANNEL, channelName);
preparedStatement.setInt(TENANT_ID, tenantId);
preparedStatement.setString(APP_ID, applicationUuid);
preparedStatement.setInt(TENANT_ID, tenantId);
});
String updateAppNotificationTemplateSql = isUnicodeDataType ? UPDATE_APP_NOTIFICATION_TEMPLATE_SQL_UNICODE :
UPDATE_APP_NOTIFICATION_TEMPLATE_SQL;
namedJdbcTemplate.executeUpdate(updateAppNotificationTemplateSql, preparedStatement -> {

Check warning on line 248 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L247-L248

Added lines #L247 - L248 were not covered by tests
if (isUnicodeDataType) {
preparedStatement.setNString(SUBJECT, notificationTemplate.getSubject());
preparedStatement.setNString(BODY, notificationTemplate.getBody());
preparedStatement.setNString(FOOTER, notificationTemplate.getFooter());

Check warning on line 252 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L250-L252

Added lines #L250 - L252 were not covered by tests
} else {
preparedStatement.setString(SUBJECT, notificationTemplate.getSubject());
preparedStatement.setString(BODY, notificationTemplate.getBody());
preparedStatement.setString(FOOTER, notificationTemplate.getFooter());

Check warning on line 256 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L254-L256

Added lines #L254 - L256 were not covered by tests
}
preparedStatement.setString(CONTENT_TYPE, notificationTemplate.getContentType());
preparedStatement.setString(TEMPLATE_KEY, locale.toLowerCase());
preparedStatement.setString(TYPE_KEY, displayName.toLowerCase());
preparedStatement.setString(CHANNEL, channelName);
preparedStatement.setInt(TENANT_ID, tenantId);
preparedStatement.setString(APP_ID, applicationUuid);
preparedStatement.setInt(TENANT_ID, tenantId);
});

Check warning on line 265 in components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java

View check run for this annotation

Codecov / codecov/patch

components/email-mgt/org.wso2.carbon.email.mgt/src/main/java/org/wso2/carbon/email/mgt/store/dao/AppNotificationTemplateDAO.java#L258-L265

Added lines #L258 - L265 were not covered by tests
} catch (DataAccessException e) {
String error =
String.format("Error while updating %s template %s of type %s from application %s in %s tenant.",
Expand Down
Loading

0 comments on commit d01357e

Please sign in to comment.