mirror of
https://github.com/floci-io/floci.git
synced 2026-12-04 10:38:00 -05:00
fix(ses): align export job lookup and cancel with SES (#8385)
Probed against SES on 2026-11-14: - GetExportJob and CancelExportJob answer 404 NotFoundException "Job ID: <id> not found" for an unknown id shaped like a UUID, and keep 400 "Invalid JobId" for any other id. - CancelExportJob on an already cancelled job succeeds instead of being refused. A completed job is still refused. - A cancelled job no longer gains a CompletedTimestamp. - GetExportJob always returns the Statistics structure, empty until a record count exists. The probe used one random UUID and one plain word, so the canonical UUID form is Floci's reading of where SES separates the two errors.
This commit is contained in:
1 parent
6de963848b
commit
4373e83af1
6 files changed
+136
-15
No files matched your search
+8
-2
@@ -30,6 +30,7 @@ import software.amazon.awssdk.services.sesv2.model.ListExportJobsRequest;
|
||||
import software.amazon.awssdk.services.sesv2.model.ListExportJobsResponse;
|
||||
import software.amazon.awssdk.services.sesv2.model.Message;
|
||||
import software.amazon.awssdk.services.sesv2.model.MessageInsightsDataSource;
|
||||
import software.amazon.awssdk.services.sesv2.model.NotFoundException;
|
||||
import software.amazon.awssdk.services.sesv2.model.PutAccountVdmAttributesRequest;
|
||||
import software.amazon.awssdk.services.sesv2.model.SendEmailRequest;
|
||||
import software.amazon.awssdk.services.sesv2.model.VdmAttributes;
|
||||
@@ -149,8 +150,13 @@ class SesExportJobTest {
|
||||
|
||||
@Test
|
||||
@Order(6)
|
||||
@DisplayName("an unknown job id is a BadRequest rather than a NotFound")
|
||||
void unknownJobIsABadRequest() {
|
||||
@DisplayName("an unknown job id is a NotFound when shaped like an id, a BadRequest otherwise")
|
||||
void unknownJobIsNotFoundOrBadRequest() {
|
||||
String unknown = "7b9563a7-12fc-4129-ab8c-bd4783006c08";
|
||||
assertThatThrownBy(() -> sesV2.getExportJob(
|
||||
GetExportJobRequest.builder().jobId(unknown).build()))
|
||||
.isInstanceOf(NotFoundException.class)
|
||||
.hasMessageContaining("Job ID: <" + unknown + "> not found");
|
||||
assertThatThrownBy(() -> sesV2.getExportJob(
|
||||
GetExportJobRequest.builder().jobId("no-such-job").build()))
|
||||
.isInstanceOf(BadRequestException.class)
|
||||
|
||||
Reference in new issue
Block a user