mirror of
https://github.com/google/nomulus
synced 2026-02-10 23:10:39 +00:00
Add a parameter to prevent spec11 from sending emails (#1407)
This commit is contained in:
@@ -114,4 +114,10 @@ class ReportingModuleTest {
|
||||
when(req.getParameter("date")).thenReturn("2017-07-02");
|
||||
assertThat(ReportingModule.provideDate(req, clock)).isEqualTo(new LocalDate(2017, 7, 2));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEmptyEmail_returnsTrue() {
|
||||
when(req.getParameter("email")).thenReturn(null);
|
||||
assertThat(ReportingModule.provideSendEmail(req)).isTrue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ class GenerateSpec11ReportActionTest extends BeamActionTestBase {
|
||||
"api_key/a",
|
||||
clock.nowUtc().toLocalDate(),
|
||||
PrimaryDatabase.DATASTORE,
|
||||
true,
|
||||
clock,
|
||||
response,
|
||||
dataflow);
|
||||
@@ -75,6 +76,7 @@ class GenerateSpec11ReportActionTest extends BeamActionTestBase {
|
||||
"api_key/a",
|
||||
clock.nowUtc().toLocalDate(),
|
||||
PrimaryDatabase.DATASTORE,
|
||||
true,
|
||||
clock,
|
||||
response,
|
||||
dataflow);
|
||||
@@ -90,4 +92,26 @@ class GenerateSpec11ReportActionTest extends BeamActionTestBase {
|
||||
.param("date", "2018-06-11");
|
||||
assertTasksEnqueued("beam-reporting", matcher);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_noEmail() throws IOException {
|
||||
action =
|
||||
new GenerateSpec11ReportAction(
|
||||
"test-project",
|
||||
"us-east1-c",
|
||||
"gs://staging-project/staging-bucket/",
|
||||
"gs://reporting-project/reporting-bucket/",
|
||||
"api_key/a",
|
||||
clock.nowUtc().toLocalDate(),
|
||||
PrimaryDatabase.DATASTORE,
|
||||
false,
|
||||
clock,
|
||||
response,
|
||||
dataflow);
|
||||
action.run();
|
||||
assertThat(response.getStatus()).isEqualTo(SC_OK);
|
||||
assertThat(response.getContentType()).isEqualTo(MediaType.PLAIN_TEXT_UTF_8);
|
||||
assertThat(response.getPayload()).isEqualTo("Launched Spec11 pipeline: jobid");
|
||||
assertNoTasksEnqueued("beam-reporting");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user