localstack / localstack-java-utils

☕ Java utilities and JUnit integration for LocalStack
Apache License 2.0
75 stars 43 forks source link

Allow specification of custom handler methods in Local lambdas #75

Closed dfangl closed 3 years ago

dfangl commented 3 years ago

Currently, when executing Java Lambdas in local executor mode, the class::method notation is not supported for specifying a specific method for the handler, it was resulting in an error due to a wrong class path (which included the ::) instead.

This PR will now determine the correct handler method (if manually specified, otherwise the behavior is not changed), and executes it using reflection.

Also, it fixes a bug when a lambda tries to use gson on the context, which will fail with a StackOverflowError due to a circular reference with the logger by making the logger transient (should not be included in any json anyway).

Still todo: