@@ -88,7 +88,7 @@ public void saveInProgress_defaultConfig() {
88
88
assertThat (dr .getStatus ()).isEqualTo (DataRecord .Status .INPROGRESS );
89
89
assertThat (dr .getExpiryTimestamp ()).isEqualTo (now .plus (3600 , ChronoUnit .SECONDS ).getEpochSecond ());
90
90
assertThat (dr .getResponseData ()).isNull ();
91
- assertThat (dr .getIdempotencyKey ()).isEqualTo ("testFunction#47261bd5b456f400f8d191cfb3a7482f " );
91
+ assertThat (dr .getIdempotencyKey ()).isEqualTo ("testFunction#7b40f56c086de5aa91dc467456329ed2 " );
92
92
assertThat (dr .getPayloadHash ()).isEqualTo ("" );
93
93
assertThat (dr .getInProgressExpiryTimestamp ()).isEmpty ();
94
94
assertThat (status ).isEqualTo (1 );
@@ -105,7 +105,7 @@ public void saveInProgress_withRemainingTime() {
105
105
assertThat (dr .getStatus ()).isEqualTo (DataRecord .Status .INPROGRESS );
106
106
assertThat (dr .getExpiryTimestamp ()).isEqualTo (now .plus (3600 , ChronoUnit .SECONDS ).getEpochSecond ());
107
107
assertThat (dr .getResponseData ()).isNull ();
108
- assertThat (dr .getIdempotencyKey ()).isEqualTo ("testFunction#47261bd5b456f400f8d191cfb3a7482f " );
108
+ assertThat (dr .getIdempotencyKey ()).isEqualTo ("testFunction#7b40f56c086de5aa91dc467456329ed2 " );
109
109
assertThat (dr .getPayloadHash ()).isEqualTo ("" );
110
110
assertThat (dr .getInProgressExpiryTimestamp ().orElse (-1 )).isEqualTo (now .plus (lambdaTimeoutMs , ChronoUnit .MILLIS ).toEpochMilli ());
111
111
assertThat (status ).isEqualTo (1 );
@@ -216,7 +216,7 @@ public void saveSuccess_shouldUpdateRecord() throws JsonProcessingException {
216
216
assertThat (dr .getStatus ()).isEqualTo (DataRecord .Status .COMPLETED );
217
217
assertThat (dr .getExpiryTimestamp ()).isEqualTo (now .plus (3600 , ChronoUnit .SECONDS ).getEpochSecond ());
218
218
assertThat (dr .getResponseData ()).isEqualTo (JsonConfig .get ().getObjectMapper ().writeValueAsString (product ));
219
- assertThat (dr .getIdempotencyKey ()).isEqualTo ("testFunction#47261bd5b456f400f8d191cfb3a7482f " );
219
+ assertThat (dr .getIdempotencyKey ()).isEqualTo ("testFunction#7b40f56c086de5aa91dc467456329ed2 " );
220
220
assertThat (dr .getPayloadHash ()).isEqualTo ("" );
221
221
assertThat (status ).isEqualTo (2 );
222
222
assertThat (cache ).isEmpty ();
@@ -235,11 +235,11 @@ public void saveSuccess_withCacheEnabled_shouldSaveInCache() throws JsonProcessi
235
235
236
236
assertThat (status ).isEqualTo (2 );
237
237
assertThat (cache ).hasSize (1 );
238
- DataRecord record = cache .get ("testFunction#47261bd5b456f400f8d191cfb3a7482f " );
238
+ DataRecord record = cache .get ("testFunction#7b40f56c086de5aa91dc467456329ed2 " );
239
239
assertThat (record .getStatus ()).isEqualTo (DataRecord .Status .COMPLETED );
240
240
assertThat (record .getExpiryTimestamp ()).isEqualTo (now .plus (3600 , ChronoUnit .SECONDS ).getEpochSecond ());
241
241
assertThat (record .getResponseData ()).isEqualTo (JsonConfig .get ().getObjectMapper ().writeValueAsString (product ));
242
- assertThat (record .getIdempotencyKey ()).isEqualTo ("testFunction#47261bd5b456f400f8d191cfb3a7482f " );
242
+ assertThat (record .getIdempotencyKey ()).isEqualTo ("testFunction#7b40f56c086de5aa91dc467456329ed2 " );
243
243
assertThat (record .getPayloadHash ()).isEqualTo ("" );
244
244
}
245
245
@@ -257,7 +257,7 @@ public void getRecord_shouldReturnRecordFromPersistence() throws IdempotencyItem
257
257
258
258
Instant now = Instant .now ();
259
259
DataRecord record = persistenceStore .getRecord (JsonConfig .get ().getObjectMapper ().valueToTree (event ), now );
260
- assertThat (record .getIdempotencyKey ()).isEqualTo ("testFunction.myfunc#47261bd5b456f400f8d191cfb3a7482f " );
260
+ assertThat (record .getIdempotencyKey ()).isEqualTo ("testFunction.myfunc#7b40f56c086de5aa91dc467456329ed2 " );
261
261
assertThat (record .getStatus ()).isEqualTo (DataRecord .Status .INPROGRESS );
262
262
assertThat (record .getResponseData ()).isEqualTo ("Response" );
263
263
assertThat (status ).isEqualTo (0 );
@@ -272,15 +272,15 @@ public void getRecord_cacheEnabledNotExpired_shouldReturnRecordFromCache() throw
272
272
273
273
Instant now = Instant .now ();
274
274
DataRecord dr = new DataRecord (
275
- "testFunction.myfunc#47261bd5b456f400f8d191cfb3a7482f " ,
275
+ "testFunction.myfunc#7b40f56c086de5aa91dc467456329ed2 " ,
276
276
DataRecord .Status .COMPLETED ,
277
277
now .plus (3600 , ChronoUnit .SECONDS ).getEpochSecond (),
278
278
"result of the function" ,
279
279
null );
280
- cache .put ("testFunction.myfunc#47261bd5b456f400f8d191cfb3a7482f " , dr );
280
+ cache .put ("testFunction.myfunc#7b40f56c086de5aa91dc467456329ed2 " , dr );
281
281
282
282
DataRecord record = persistenceStore .getRecord (JsonConfig .get ().getObjectMapper ().valueToTree (event ), now );
283
- assertThat (record .getIdempotencyKey ()).isEqualTo ("testFunction.myfunc#47261bd5b456f400f8d191cfb3a7482f " );
283
+ assertThat (record .getIdempotencyKey ()).isEqualTo ("testFunction.myfunc#7b40f56c086de5aa91dc467456329ed2 " );
284
284
assertThat (record .getStatus ()).isEqualTo (DataRecord .Status .COMPLETED );
285
285
assertThat (record .getResponseData ()).isEqualTo ("result of the function" );
286
286
assertThat (status ).isEqualTo (-1 ); // getRecord must not be called (retrieve from cache)
@@ -295,15 +295,15 @@ public void getRecord_cacheEnabledExpired_shouldReturnRecordFromPersistence() th
295
295
296
296
Instant now = Instant .now ();
297
297
DataRecord dr = new DataRecord (
298
- "testFunction.myfunc#47261bd5b456f400f8d191cfb3a7482f " ,
298
+ "testFunction.myfunc#7b40f56c086de5aa91dc467456329ed2 " ,
299
299
DataRecord .Status .COMPLETED ,
300
300
now .minus (3 , ChronoUnit .SECONDS ).getEpochSecond (),
301
301
"result of the function" ,
302
302
null );
303
- cache .put ("testFunction.myfunc#47261bd5b456f400f8d191cfb3a7482f " , dr );
303
+ cache .put ("testFunction.myfunc#7b40f56c086de5aa91dc467456329ed2 " , dr );
304
304
305
305
DataRecord record = persistenceStore .getRecord (JsonConfig .get ().getObjectMapper ().valueToTree (event ), now );
306
- assertThat (record .getIdempotencyKey ()).isEqualTo ("testFunction.myfunc#47261bd5b456f400f8d191cfb3a7482f " );
306
+ assertThat (record .getIdempotencyKey ()).isEqualTo ("testFunction.myfunc#7b40f56c086de5aa91dc467456329ed2 " );
307
307
assertThat (record .getStatus ()).isEqualTo (DataRecord .Status .INPROGRESS );
308
308
assertThat (record .getResponseData ()).isEqualTo ("Response" );
309
309
assertThat (status ).isEqualTo (0 );
@@ -347,8 +347,8 @@ public void deleteRecord_cacheEnabled_shouldDeleteRecordFromCache() {
347
347
persistenceStore .configure (IdempotencyConfig .builder ()
348
348
.withUseLocalCache (true ).build (), null , cache );
349
349
350
- cache .put ("testFunction#47261bd5b456f400f8d191cfb3a7482f " ,
351
- new DataRecord ("testFunction#47261bd5b456f400f8d191cfb3a7482f " , DataRecord .Status .COMPLETED , 123 , null , null ));
350
+ cache .put ("testFunction#7b40f56c086de5aa91dc467456329ed2 " ,
351
+ new DataRecord ("testFunction#7b40f56c086de5aa91dc467456329ed2 " , DataRecord .Status .COMPLETED , 123 , null , null ));
352
352
persistenceStore .deleteRecord (JsonConfig .get ().getObjectMapper ().valueToTree (event ), new ArithmeticException ());
353
353
assertThat (status ).isEqualTo (3 );
354
354
assertThat (cache ).isEmpty ();
0 commit comments