Changes for page Java Unit Testing
Last modified by Vincent Massol on 2023/05/03 15:57
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -252,6 +252,18 @@ 252 252 253 253 You can use ##@AfterComponent## to perform some setup after the mock components have been setup. 254 254 255 +=== Order === 256 + 257 +It's important to understand the order used to resolve all those annotations: 258 + 259 +1. Create an empty Mockito Component Manager 260 +1. Inject ##@InjectComponentManager## fields 261 +1. Inject ##@MockComponent## fields 262 +1. Call ##@BeforeComponent## methods 263 +1. Fill the Mockito Component Manager (with components matching the ##@AllComponent## and ##@ComponentList## annotations) 264 +1. Call ##@AfterComponent## methods 265 +1. Inject ##@InjectMockComponents## fields 266 + 255 255 == Capturing and Asserting Logs == 256 256 257 257 If the code under tests output logs, they need to be captured and possibly asserted. For example: