File tree 2 files changed +33
-1
lines changed
main/java/com/netflix/simianarmy/aws
test/java/com/netflix/simianarmy/aws
2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public abstract class AWSEmailNotifier implements MonkeyEmailNotifier {
40
40
/** The Constant LOGGER. */
41
41
private static final Logger LOGGER = LoggerFactory .getLogger (AWSEmailNotifier .class );
42
42
private static final String EMAIL_PATTERN =
43
- "^[_A-Za-z0-9-\\ +\\ .]+(.[_A-Za-z0-9-]+)*@"
43
+ "^[_A-Za-z0-9-\\ +\\ .# ]+(.[_A-Za-z0-9-# ]+)*@"
44
44
+ "[A-Za-z0-9-]+(\\ .[A-Za-z0-9]+)*(\\ .[A-Za-z]{2,})$" ;
45
45
46
46
private final Pattern emailPattern ;
Original file line number Diff line number Diff line change
1
+ package com .netflix .simianarmy .aws ;
2
+
3
+ import org .testng .Assert ;
4
+ import org .testng .annotations .Test ;
5
+
6
+ // CHECKSTYLE IGNORE MagicNumberCheck
7
+ public class TestAWSEmailNotifier extends AWSEmailNotifier {
8
+ public TestAWSEmailNotifier () {
9
+ super (null );
10
+ }
11
+
12
+ @ Override
13
+ public String buildEmailSubject (String to ) {
14
+ return null ;
15
+ }
16
+
17
+ @ Override
18
+ public String [] getCcAddresses (String to ) {
19
+ return new String [0 ];
20
+ }
21
+
22
+ @ Override
23
+ public String getSourceAddress (String to ) {
24
+ return null ;
25
+ }
26
+
27
+ @ Test
28
+ public void testEmailWithHashIsValid () {
29
+ TestAWSEmailNotifier emailNotifier = new TestAWSEmailNotifier ();
30
+ Assert .assertTrue (emailNotifier .isValidEmail ("#bla-#name@domain-test.com" ), "Email with hash is not valid" );
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments