I have a scenario where I am consuming an event and saving the details in the DB. Now the record that is being stored in the database has the id field autogenerated @GeneratedValue(strategy = GenerationType.IDENTITY)
.
In my test case I need to check if data is getting stored in the DB or not and is as per expectation.
But I am not sure how will I do findById()
of SpringBoot Crud/JPA Repository since I do not know what value got generated.
Any help would be appreciated.