File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
modules/ingest-common/src
main/java/org/elasticsearch/ingest/common
test/java/org/elasticsearch/ingest/common Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -71,11 +71,11 @@ final class CefParser {
7171 private static final Pattern MAC_ADDRESS_PATTERN = Pattern .compile (
7272 Stream .of (
7373 // Combined colon and hyphen separated 6-group patterns
74- "(([0-9A-Fa-f]{2}[:| -]){5}[0-9A-Fa-f]{2})" ,
74+ "(([0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2})" ,
7575 // Dot-separated 6-group pattern
7676 "([0-9A-Fa-f]{4}\\ .){2}[0-9A-Fa-f]{4}" ,
7777 // Combined colon and hyphen separated 8-group patterns
78- "([0-9A-Fa-f]{2}[:| -]){7}[0-9A-Fa-f]{2}" ,
78+ "([0-9A-Fa-f]{2}[:-]){7}[0-9A-Fa-f]{2}" ,
7979 // Dot-separated EUI-64
8080 "([0-9A-Fa-f]{4}\\ .){3}[0-9A-Fa-f]{4}"
8181 ).collect (Collectors .joining ("|" , "^(" , ")$" ))
Original file line number Diff line number Diff line change @@ -972,9 +972,8 @@ public void testToMacAddressWithSeparators() {
972972
973973 public void testInvalidMacAddressSeparator () {
974974 CefParser parser = new CefParser (ZoneId .of ("UTC" ), false );
975- String macAddress = "00|0D|60|AF|1B|61" ;
976- String result = parser .toMACAddress (macAddress );
977- assertEquals ("00|0D|60|AF|1B|61" , result );
975+ IllegalArgumentException e = expectThrows (IllegalArgumentException .class , () -> parser .toMACAddress ("00|0D|60|AF|1B|61" ));
976+ assertThat (e .getMessage (), equalTo ("Invalid MAC address format" ));
978977 }
979978
980979 public void testEUI48ToMacAddressWithOutSeparators () {
You can’t perform that action at this time.
0 commit comments