diff --git a/server/src/main/resources/job-started-email.html b/server/src/main/resources/job-started-email.html index e94c0f42..27c0dd48 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 1ffedd25..f5e78348 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"); + } }