Commit 34fcdfd
authored
* tech(idempotency): Replace DynamoDB Local with Mockito mocks in unit tests (#1932)
Replaced external DynamoDB Local dependency with self-contained Mockito mocks
in powertools-idempotency-dynamodb module unit tests.
Changes:
- Rewrote DynamoDBPersistenceStoreTest with 12 Mockito-based tests
- Removed DynamoDB Local dependency and Maven plugins from pom.xml
- Deleted DynamoDBConfig test harness (no longer needed)
- Deleted IdempotencyTest and IdempotencyFunction (redundant with e2e tests)
- Added Mockito dependencies to pom.xml
All tests pass (13/13). No production code changes. E2E tests remain unchanged.
Related to #1932
* Fix SonarCloud restricted identifier warnings
- Rename variable 'record' to 'dataRecord' (9 occurrences)
- Resolves Java keyword conflict in test file
* Use mockito-subclass for GraalVM native tests
- Add mockito-subclass dependency in native profile
- Remove skipNativeTests flag
- Follows pattern from powertools-metrics module
- All 61 tests pass in idempotency parent module
* Strengthen test assertions for condition expression and returnValuesOnConditionCheckFailure
- Add full condition expression validation in putRecord_shouldSendCorrectPutItemRequest
- Add returnValuesOnConditionCheckFailure='ALL_OLD' assertion
- Protects bugfix from #1285 and behavior from #1821
- Per code review feedback from @phipag
1 parent 931a1b0 commit 34fcdfd
5 files changed
Lines changed: 278 additions & 541 deletions
File tree
- powertools-idempotency/powertools-idempotency-dynamodb
- src/test/java/software/amazon/lambda/powertools/idempotency/persistence/dynamodb
- handlers
Lines changed: 15 additions & 70 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
80 | 90 | | |
81 | 91 | | |
82 | 92 | | |
| |||
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
121 | 127 | | |
122 | 128 | | |
123 | 129 | | |
| |||
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | 158 | | |
204 | 159 | | |
205 | 160 | | |
| |||
212 | 167 | | |
213 | 168 | | |
214 | 169 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | 170 | | |
226 | 171 | | |
227 | 172 | | |
| |||
Lines changed: 0 additions & 65 deletions
This file was deleted.
0 commit comments