My project has three test packages: post, security, and user.
In the current situation, if you run all the tests at the same time, there is a NoSuchBean error in both the TokenProviderTest and the JwtServiceTest.
but
- If you test the security package separately,
- In the case of annotating all UserRepositoryTests and testing them in full,
- If you change the CustomUserDetailsServiceTest written in Mock to @DataJpaTest and @ComponentScan, it will run normally.
As far as I know in my head, each test class runs without affecting other tests like a separate server, but I have no idea what factors affect each other, so I ask you this question.
I'd appreciate it if you could answer.
CodePudding user response:
