Skip to content

Commit bd8e3cd

Browse files
committed
Remove unncessary try catch Throwable in unit tests
1 parent 9b4fe65 commit bd8e3cd

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

powertools-idempotency/powertools-idempotency-core/src/test/java/software/amazon/lambda/powertools/idempotency/handlers/PowertoolsIdempotencyFunction.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ public boolean processCalled() {
3636
@Override
3737
public Basket handleRequest(Product input, Context context) {
3838
Idempotency.registerLambdaContext(context);
39-
try {
40-
return PowertoolsIdempotency.makeIdempotent(this::process, input, Basket.class);
41-
} catch (Throwable e) {
42-
throw new RuntimeException(e);
43-
}
39+
40+
return PowertoolsIdempotency.makeIdempotent(this::process, input, Basket.class);
4441
}
4542

4643
private Basket process(Product input) {

powertools-idempotency/powertools-idempotency-core/src/test/java/software/amazon/lambda/powertools/idempotency/handlers/PowertoolsIdempotencyMultiArgFunction.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,8 @@ public String getExtraData() {
4141
@Override
4242
public Basket handleRequest(Product input, Context context) {
4343
Idempotency.registerLambdaContext(context);
44-
try {
45-
return PowertoolsIdempotency.makeIdempotent(input.getId(), () -> process(input, "extra-data"),
46-
Basket.class);
47-
} catch (Throwable e) {
48-
throw new RuntimeException(e);
49-
}
44+
45+
return PowertoolsIdempotency.makeIdempotent(input.getId(), () -> process(input, "extra-data"), Basket.class);
5046
}
5147

5248
private Basket process(Product input, String extraData) {

0 commit comments

Comments
 (0)