|
1 | 1 | package com.amazonaws.services.lambda.runtime.events.transformers.dynamodb;
|
2 | 2 |
|
3 |
| -import com.amazonaws.services.dynamodbv2.model.AttributeValue; |
4 |
| -import com.amazonaws.services.dynamodbv2.model.StreamViewType; |
| 3 | +import com.amazonaws.services.lambda.runtime.events.models.dynamodb.AttributeValue; |
| 4 | +import com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamViewType; |
5 | 5 | import org.junit.jupiter.api.Assertions;
|
6 | 6 | import org.junit.jupiter.api.Test;
|
7 | 7 | import software.amazon.awssdk.services.dynamodb.model.StreamRecord;
|
@@ -37,62 +37,63 @@ class DynamodbStreamRecordTransformerTest {
|
37 | 37 | private static final Date approximateCreationDateTime = new Date();
|
38 | 38 |
|
39 | 39 | //region StreamRecord_event
|
40 |
| - public static final com.amazonaws.services.dynamodbv2.model.StreamRecord streamRecord_event = new com.amazonaws.services.dynamodbv2.model.StreamRecord() |
41 |
| - .withKeys(ImmutableMap.<String, AttributeValue> builder() |
42 |
| - .put(keyNK, attributeValueN_event) |
43 |
| - .put(keyNSK, attributeValueNS_event) |
44 |
| - .put(keySK, attributeValueS_event) |
45 |
| - .put(keySSK, attributeValueSS_event) |
46 |
| - .put(keyBK, attributeValueB_event) |
47 |
| - .put(keyBSK, attributeValueBS_event) |
48 |
| - .put(keyBOOLK, attributeValueBOOL_event) |
49 |
| - .put(keyNULK, attributeValueNUL_event) |
50 |
| - .put(keyMK, attributeValueM_event) |
51 |
| - .put(keyLK, attributeValueL_event) |
52 |
| - .build() |
53 |
| - ) |
54 |
| - .withOldImage(ImmutableMap.of( |
55 |
| - oldImageSK, attributeValueS_event, |
56 |
| - keyNK, attributeValueN_event |
57 |
| - )) |
58 |
| - .withNewImage(ImmutableMap.of( |
59 |
| - newImageSK, attributeValueS_event, |
60 |
| - keyNK, attributeValueN_event |
61 |
| - )) |
62 |
| - .withStreamViewType(StreamViewType.fromValue(streamViewType)) |
63 |
| - .withSequenceNumber(sequenceNumber) |
64 |
| - .withSizeBytes(sizeBytes) |
65 |
| - .withApproximateCreationDateTime(approximateCreationDateTime); |
| 40 | + public static final com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord_event = |
| 41 | + new com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord() |
| 42 | + .withKeys(ImmutableMap.<String, AttributeValue> builder() |
| 43 | + .put(keyNK, attributeValueN_event) |
| 44 | + .put(keyNSK, attributeValueNS_event) |
| 45 | + .put(keySK, attributeValueS_event) |
| 46 | + .put(keySSK, attributeValueSS_event) |
| 47 | + .put(keyBK, attributeValueB_event) |
| 48 | + .put(keyBSK, attributeValueBS_event) |
| 49 | + .put(keyBOOLK, attributeValueBOOL_event) |
| 50 | + .put(keyNULK, attributeValueNUL_event) |
| 51 | + .put(keyMK, attributeValueM_event) |
| 52 | + .put(keyLK, attributeValueL_event) |
| 53 | + .build() |
| 54 | + ) |
| 55 | + .withOldImage(ImmutableMap.of( |
| 56 | + oldImageSK, attributeValueS_event, |
| 57 | + keyNK, attributeValueN_event |
| 58 | + )) |
| 59 | + .withNewImage(ImmutableMap.of( |
| 60 | + newImageSK, attributeValueS_event, |
| 61 | + keyNK, attributeValueN_event |
| 62 | + )) |
| 63 | + .withStreamViewType(StreamViewType.fromValue(streamViewType)) |
| 64 | + .withSequenceNumber(sequenceNumber) |
| 65 | + .withSizeBytes(sizeBytes) |
| 66 | + .withApproximateCreationDateTime(approximateCreationDateTime); |
66 | 67 | //endregion
|
67 | 68 |
|
68 | 69 | //region StreamRecord_v2
|
69 | 70 | public static final StreamRecord streamRecord_v2 = StreamRecord.builder()
|
70 |
| - .approximateCreationDateTime(approximateCreationDateTime.toInstant()) |
71 |
| - .keys(ImmutableMap.<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> builder() |
72 |
| - .put(keyNK, attributeValueN_v2) |
73 |
| - .put(keyNSK, attributeValueNS_v2) |
74 |
| - .put(keySK, attributeValueS_v2) |
75 |
| - .put(keySSK, attributeValueSS_v2) |
76 |
| - .put(keyBK, attributeValueB_v2) |
77 |
| - .put(keyBSK, attributeValueBS_v2) |
78 |
| - .put(keyBOOLK, attributeValueBOOL_v2) |
79 |
| - .put(keyNULK, attributeValueNUL_v2) |
80 |
| - .put(keyMK, attributeValueM_v2) |
81 |
| - .put(keyLK, attributeValueL_v2) |
82 |
| - .build() |
83 |
| - ) |
84 |
| - .oldImage(ImmutableMap.of( |
85 |
| - oldImageSK, attributeValueS_v2, |
86 |
| - keyNK, attributeValueN_v2 |
87 |
| - )) |
88 |
| - .newImage(ImmutableMap.of( |
89 |
| - newImageSK, attributeValueS_v2, |
90 |
| - keyNK, attributeValueN_v2 |
91 |
| - )) |
92 |
| - .sequenceNumber(sequenceNumber) |
93 |
| - .sizeBytes(sizeBytes) |
94 |
| - .streamViewType(streamViewType) |
95 |
| - .build(); |
| 71 | + .approximateCreationDateTime(approximateCreationDateTime.toInstant()) |
| 72 | + .keys(ImmutableMap.<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> builder() |
| 73 | + .put(keyNK, attributeValueN_v2) |
| 74 | + .put(keyNSK, attributeValueNS_v2) |
| 75 | + .put(keySK, attributeValueS_v2) |
| 76 | + .put(keySSK, attributeValueSS_v2) |
| 77 | + .put(keyBK, attributeValueB_v2) |
| 78 | + .put(keyBSK, attributeValueBS_v2) |
| 79 | + .put(keyBOOLK, attributeValueBOOL_v2) |
| 80 | + .put(keyNULK, attributeValueNUL_v2) |
| 81 | + .put(keyMK, attributeValueM_v2) |
| 82 | + .put(keyLK, attributeValueL_v2) |
| 83 | + .build() |
| 84 | + ) |
| 85 | + .oldImage(ImmutableMap.of( |
| 86 | + oldImageSK, attributeValueS_v2, |
| 87 | + keyNK, attributeValueN_v2 |
| 88 | + )) |
| 89 | + .newImage(ImmutableMap.of( |
| 90 | + newImageSK, attributeValueS_v2, |
| 91 | + keyNK, attributeValueN_v2 |
| 92 | + )) |
| 93 | + .sequenceNumber(sequenceNumber) |
| 94 | + .sizeBytes(sizeBytes) |
| 95 | + .streamViewType(streamViewType) |
| 96 | + .build(); |
96 | 97 | //endregion
|
97 | 98 |
|
98 | 99 | @Test
|
|
0 commit comments