Mongo creates new records when JUnit runs, so size of repository keeps increasing
ABHIJEET-SRIDHAR-M opened this issue · 1 comments
When we run tests, the new record in repository doesn't go away. This keeps the size going up as many times as i run the tests. Current test fail -
Assertions.assertEquals(1, productRepository.findAll().size()); Expected [1] but was [8].
I added the changes from this repo while following the youtube tutorial. The first test for checking the "HTTP status created" works and passes the tests.
Not sure if this is related, but my test outputs show weird spacing (ss attached). This leads me to think there is some form of leak/garbage value going somewhere.
Okay, this was a @DynamicPropertySource annotation missed on the setProperties function. I'm leaving this open to see if we can solve this spacing issue, but feel free to close it.