mirror of
https://github.com/google/nomulus
synced 2026-09-08 17:17:02 +00:00
Add fallback for Spec11 ThreatMatch parser (#1806)
This commit is contained in:
+18
@@ -100,6 +100,24 @@ public class Spec11RegistrarThreatMatchesParserTest {
|
||||
assertThat(objectWithExtraFields).isEqualTo(objectWithoutExtraFields);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_worksWithOutdatedField() throws Exception {
|
||||
ThreatMatch objectWithOutdatedField =
|
||||
ThreatMatch.fromJSON(
|
||||
new JSONObject(
|
||||
ImmutableMap.of(
|
||||
"threatType", "MALWARE",
|
||||
"fullyQualifiedDomainName", "c.com")));
|
||||
ThreatMatch objectWithoutOutdatedFields =
|
||||
ThreatMatch.fromJSON(
|
||||
new JSONObject(
|
||||
ImmutableMap.of(
|
||||
"threatType", "MALWARE",
|
||||
"domainName", "c.com")));
|
||||
|
||||
assertThat(objectWithOutdatedField).isEqualTo(objectWithoutOutdatedFields);
|
||||
}
|
||||
|
||||
/** The expected contents of the sample spec11 report file */
|
||||
public static ImmutableSet<RegistrarThreatMatches> sampleThreatMatches() throws Exception {
|
||||
return ImmutableSet.of(getMatchA(), getMatchB());
|
||||
|
||||
Reference in New Issue
Block a user