From fedde87d80a928e58aa2a1ca70653e4b2dd238a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Rodr=C3=ADguez?= <36035218+grojeda@users.noreply.github.com> Date: Tue, 27 Oct 2026 09:53:01 +1100 Subject: [PATCH] fix: remove hardcoded mooring citation from download email The job-started email template carried a static paragraph with citation requirements for the Ningaloo (TAN100) and Ocean Reference Station 65m (ORS065) moorings, so it was sent with every download regardless of the dataset. Remove that paragraph; keep the generic IMOS acknowledgement and the "as is" disclaimer untouched. Add a regression test asserting the generated email no longer contains the mooring-specific text. Refs aodn/backlog#9241 --- .../src/main/resources/job-started-email.html | 1 - .../server/processes/RestServicesTest.java | 36 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/server/src/main/resources/job-started-email.html b/server/src/main/resources/job-started-email.html index e94c0f42d..27c0dd48e 100644 --- a/server/src/main/resources/job-started-email.html +++ b/server/src/main/resources/job-started-email.html @@ -1459,7 +1459,6 @@
-

If using data from the Ningaloo (TAN100) mooring, please add to the citation - "Department of Jobs, Tourism, Science and Innovation (DJTSI), Western Australian Government". If using data from the Ocean Reference Station 65m (ORS065) mooring, please add to the citation - "Sydney Water Corporation".

Data, products and services from IMOS are provided "as is" without any warranty as to fitness for a particular purpose. By using this data you are accepting the license agreement and terms specified above. You accept all risks and responsibility for losses, damages, costs and other consequences resulting directly or indirectly from using this site and any information or material available from it.

diff --git a/server/src/test/java/au/org/aodn/ogcapi/server/processes/RestServicesTest.java b/server/src/test/java/au/org/aodn/ogcapi/server/processes/RestServicesTest.java index 1ffedd251..f5e783481 100644 --- a/server/src/test/java/au/org/aodn/ogcapi/server/processes/RestServicesTest.java +++ b/server/src/test/java/au/org/aodn/ogcapi/server/processes/RestServicesTest.java @@ -17,10 +17,13 @@ import software.amazon.awssdk.services.batch.model.SubmitJobResponse; import java.util.HashMap; +import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyMap; import static org.mockito.Mockito.*; @@ -203,4 +206,37 @@ public void estimateDownloadBytesWithoutTheOutputSizeThrows() { assertThrows(IllegalStateException.class, () -> services.estimateDownloadBytes(estimateRequest())); } + + /** + * Regression guard for aodn/backlog#9241: the download confirmation email template used to + * carry a hardcoded paragraph with citation requirements for the Ningaloo (TAN100) and Ocean + * Reference Station 65m (ORS065) moorings, so it went out with every download regardless of + * dataset. That paragraph has been removed; the generic IMOS acknowledgement and the IMOS + * "as is" disclaimer must stay. + */ + @Test + public void generatedEmailHasNoHardcodedMooringCitation() { + RestServices services = new RestServices(batchClient, new ObjectMapper(), "test-job-definition", "test-job-queue"); + + String html = services.generateStartedEmailContent( + "test-uuid", "test-dname", "non-specified", "non-specified", "non-specified", + "Test Ocean Data Collection", "https://portal.example.test/details/test-uuid", + "Cite this dataset as X.", "netcdf"); + + // The mooring-specific text must no longer appear in any email. + for (String marker : List.of("TAN100", "ORS065", "Ningaloo", "Ocean Reference Station", + "Sydney Water Corporation", "If using data from")) { + assertFalse(html.contains(marker), "email should not contain hardcoded mooring text: " + marker); + } + + // The generic IMOS acknowledgement and the "as is" disclaimer must remain. + assertTrue(html.contains("Any users of IMOS data are required to clearly acknowledge"), + "generic IMOS acknowledgement must stay"); + assertTrue(html.contains("Data, products and services from IMOS are provided \"as is\" without any warranty"), + "IMOS disclaimer must stay"); + + // The suggested citation placeholder is still populated and no template markers leak. + assertTrue(html.contains("Cite this dataset as X."), "suggested citation must still render"); + assertFalse(html.contains("{{suggestedCitation}}"), "suggestedCitation placeholder must be substituted"); + } }