@@ -104,16 +104,13 @@ test.describe("Event Subscription SNS Tests", () => {
104104 ) ;
105105 } ) ;
106106
107- test ( "Verify that the duplicate event throws an error " , async ( ) => {
107+ test ( "Verify that an error is logged for a duplicate letter id " , async ( ) => {
108108 const domainId = randomUUID ( ) ;
109109 logger . info ( `Testing event subscription with domainId: ${ domainId } ` ) ;
110- const preparedEvent = createPreparedV1Event ( {
111- domainId,
112- status : "PREPARED" ,
113- } ) ;
114- const response = await sendSnsEvent ( preparedEvent ) ;
110+ const preparedEvent1 = createPreparedV1Event ( { domainId } ) ;
111+ const response1 = await sendSnsEvent ( preparedEvent1 ) ;
115112
116- expect ( response . MessageId ) . toBeTruthy ( ) ;
113+ expect ( response1 . MessageId ) . toBeTruthy ( ) ;
117114
118115 // poll supplier allocator to check if supplier has been allocated
119116 const message = await pollSupplierAllocatorLogForResolvedSpec ( domainId ) ;
@@ -129,11 +126,11 @@ test.describe("Event Subscription SNS Tests", () => {
129126 throw new Error ( "supplierId was not found in supplier allocator log" ) ;
130127 }
131128
132- // send same event again to simulate duplicate event
133- const duplicateResponse = await sendSnsEvent ( preparedEvent ) ;
134- expect ( duplicateResponse . MessageId ) . toBeTruthy ( ) ;
129+ const preparedEvent2 = createPreparedV1Event ( { domainId } ) ;
130+ const response2 = await sendSnsEvent ( preparedEvent2 ) ;
131+ expect ( response2 . MessageId ) . toBeTruthy ( ) ;
135132
136- // poll supplier upsert to check if duplicate event was processed
133+ // poll supplier upsert to check if duplicate letter id was processed
137134 await pollUpsertLetterLogForWarning ( "Letter already exists" , domainId ) ;
138135 } ) ;
139136} ) ;
0 commit comments