mirror of
https://github.com/google/nomulus.git
synced 2025-08-05 09:21:49 +02:00
Continue Spec11 emails even if one fails
One failure should not stop the rest from sending. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=241760092
This commit is contained in:
parent
bf70f83359
commit
3ad0d091f5
3 changed files with 148 additions and 132 deletions
|
@ -78,28 +78,11 @@ public class Spec11RegistrarThreatMatchesParserTest {
|
|||
}
|
||||
|
||||
/** The expected contents of the sample spec11 report file */
|
||||
public static ImmutableSet<RegistrarThreatMatches> sampleThreatMatches() throws Exception {
|
||||
static ImmutableSet<RegistrarThreatMatches> sampleThreatMatches() throws Exception {
|
||||
return ImmutableSet.of(getMatchA(), getMatchB());
|
||||
}
|
||||
|
||||
private void setupFile(String fileWithContent, String fileDate) {
|
||||
GcsFilename gcsFilename =
|
||||
new GcsFilename(
|
||||
"test-bucket",
|
||||
String.format("icann/spec11/2018-07/SPEC11_MONTHLY_REPORT_%s", fileDate));
|
||||
when(gcsUtils.existsAndNotEmpty(gcsFilename)).thenReturn(true);
|
||||
when(gcsUtils.openInputStream(gcsFilename))
|
||||
.thenAnswer(
|
||||
(args) ->
|
||||
new ByteArrayInputStream(
|
||||
loadFile(fileWithContent).getBytes(StandardCharsets.UTF_8)));
|
||||
}
|
||||
|
||||
private static String loadFile(String filename) {
|
||||
return TestDataHelper.loadFile(Spec11EmailUtils.class, filename);
|
||||
}
|
||||
|
||||
private static RegistrarThreatMatches getMatchA() throws Exception {
|
||||
static RegistrarThreatMatches getMatchA() throws Exception {
|
||||
return RegistrarThreatMatches.create(
|
||||
"a@fake.com",
|
||||
ImmutableList.of(
|
||||
|
@ -112,7 +95,7 @@ public class Spec11RegistrarThreatMatchesParserTest {
|
|||
"fullyQualifiedDomainName", "a.com")))));
|
||||
}
|
||||
|
||||
private static RegistrarThreatMatches getMatchB() throws Exception {
|
||||
static RegistrarThreatMatches getMatchB() throws Exception {
|
||||
return RegistrarThreatMatches.create(
|
||||
"b@fake.com",
|
||||
ImmutableList.of(
|
||||
|
@ -131,4 +114,21 @@ public class Spec11RegistrarThreatMatchesParserTest {
|
|||
"threatEntryMetadata", "NONE",
|
||||
"fullyQualifiedDomainName", "c.com")))));
|
||||
}
|
||||
|
||||
private void setupFile(String fileWithContent, String fileDate) {
|
||||
GcsFilename gcsFilename =
|
||||
new GcsFilename(
|
||||
"test-bucket",
|
||||
String.format("icann/spec11/2018-07/SPEC11_MONTHLY_REPORT_%s", fileDate));
|
||||
when(gcsUtils.existsAndNotEmpty(gcsFilename)).thenReturn(true);
|
||||
when(gcsUtils.openInputStream(gcsFilename))
|
||||
.thenAnswer(
|
||||
(args) ->
|
||||
new ByteArrayInputStream(
|
||||
loadFile(fileWithContent).getBytes(StandardCharsets.UTF_8)));
|
||||
}
|
||||
|
||||
private static String loadFile(String filename) {
|
||||
return TestDataHelper.loadFile(Spec11EmailUtils.class, filename);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue