When I mock a bean and assign value that initialized in @PostConstruct. It always run first so can not be assigned.
Asked
Active
Viewed 74 times
0
-
2please post the code too – SoT Jun 15 '20 at 09:55
-
Hi, my problem is similar with this post. https://github.com/cdi-unit/cdi-unit/issues/64 – Bí KoFe Jun 15 '20 at 13:57
-
Try to use @InjectMock, Let's me know the result – SoT Jun 16 '20 at 04:41
-
1thank you for your help, I found answer in this post. https://stackoverflow.com/questions/38175822/unit-testing-call-postconstruct-after-defining-mocked-behaviour – Bí KoFe Jun 16 '20 at 11:06