I have 2 JUnit tests in the same test class each one marked as @Transactional, the first one create users and the second one create users and check that we can get these users.
The problem is that when the second test runs, users created by the first test is still in the DB.
@Test
@Transactional
public void testCreateUser() throws Exception
@Test
@Transactional
public void testGetUserById() throws Exception
Do you have any idea why @Transactional is not working well in the same test class? Furthermore data is rolled back at the end of the test class.
I'm using Spring boot + Mysql + Hibernate.
Thank you for your time.