This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Twas the night before Christmas, when all through the racks | |
Not a server was alerting, not even Compaqs. | |
The backups were written to tapes with care | |
In hopes that later the data would be there. | |
The machines were nestled all snug in their sleds | |
Whilst visions of vengeance danced in their heads; | |
And oncall in his three-wolf and I in my rack. | |
Had just settled down for some syn and some ack. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@MockBean //or Mockito's @Mock | |
- it mocks the object and all its methods with do nothing and their result value will be null, | |
- use for example: when(...) methods to create mocked method behaviour | |
- use when you want to completely get rid of the object's normal behaviour | |
- caution: unmocked methods won't work -> can result in a RuntimeException during tests (@SpyBean is a remedy here apart from wider mocking) | |
@SpyBean //or Mockito's @Spy | |
- an object will behave like an @Autowired object | |
- all its methods will actually works, but we can define some custom behavior for its methods | |
- use doReturn(...) / doNothing(...) to add custom (mocked) method behaviour |