jihaozh commented on a change in pull request #4620: [TE] [Notification] 
Refactor email filters to a generalized alert filter
URL: https://github.com/apache/incubator-pinot/pull/4620#discussion_r325930055
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/detection/alert/filter/AlertFilterUtils.java
 ##########
 @@ -0,0 +1,55 @@
+/**
+ * Copyright (C) 2014-2018 LinkedIn Corp. (pinot-c...@linkedin.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pinot.thirdeye.detection.alert.filter;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import 
org.apache.pinot.thirdeye.detection.alert.DetectionAlertFilterNotification;
+
+
+public class AlertFilterUtils {
+
+  private static final String PROP_RECIPIENTS = "recipients";
+  private static final String PROP_TO = "to";
+  private static final String PROP_CC = "cc";
+  private static final String PROP_BCC = "bcc";
+
+  static final Set<String> PROP_TO_VALUE = new 
HashSet<>(Arrays.asList("t...@example.com", "t...@example.org"));
+  static final Set<String> PROP_CC_VALUE = new 
HashSet<>(Arrays.asList("cct...@example.com", "cct...@example.org"));
+  static final Set<String> PROP_BCC_VALUE = new 
HashSet<>(Arrays.asList("bcct...@example.com", "bcct...@example.org"));
+
+  private static final Map<String, Object> ALERT_PROPS = new HashMap<>();
+
+  static DetectionAlertFilterNotification makeEmailNotifications() {
+    return makeEmailNotifications(new HashSet<String>());
+  }
+
+  static DetectionAlertFilterNotification makeEmailNotifications(Set<String> 
toRecipients) {
 
 Review comment:
   Maybe use this util in the `AlertFilter` classes?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to