Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion server/src/main/resources/job-started-email.html
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,6 @@
<tr>
<td align="left" width="100%">
<div style="font-family: 'Open Sans', 'Arial', sans-serif; font-size: 16px; font-weight: 400; line-height: 150%; text-align: left; color: #090c02">
<p style="Margin:0;mso-line-height-alt:24px;font-size:16px;line-height:150%;">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".</p>
<p style="Margin:0;mso-line-height-alt:24px;font-size:16px;line-height:150%;">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.</p>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down Expand Up @@ -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");
}
}
Loading