Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractDynamoDBEventListener throws assertion error #287

Open
ethanjcohen-underarmour opened this issue Aug 16, 2020 · 0 comments
Open

Comments

@ethanjcohen-underarmour
Copy link

ethanjcohen-underarmour commented Aug 16, 2020

Expected Behavior

The event listener should only handle objects of the expected type, and should not throw an assertion error.

Actual Behavior

The event handler throws an assertion error during junit tests when a dynamo object is saved that is not of the same type (or interface, in my case).

The assertion is here: https://github.com/derjust/spring-data-dynamodb/blob/master/src/main/java/org/socialsignin/spring/data/dynamodb/mapping/event/AbstractDynamoDBEventListener.java#L113

My question is - why the assertion? The parameterization on this class implies that this event handler is specific to certain object types but that's not really true if it consumes and then fails on other types during tests. Can we remove the assertion?

Steps to Reproduce the Problem

  1. Extend the class AbstractDynamoDBEventListener with some interface as the generic parameter, like "T extends MyInterface"
  2. Save an entity that does not implement MyInterface in a test
  3. Assertion error fails the test

Specifications

  • Spring Data DynamoDB Version: 5.1.0-SNAPSHOT (2.1)
  • Spring Data Version: 2.1.3.RELEASE
  • AWS SDK Version: 1.11.472
  • Java Version: 11.0.1 - Java HotSpot(TM) 64-Bit Server VM 11.0.1+13-LTS
  • Platform Details: Mac OS X 10.14.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant