Skip to content

Extract fault injection points#5

Open
see-quick wants to merge 2 commits into
strimzi:mainfrom
see-quick:extract-faul-injection-points-into-dedicated-methods
Open

Extract fault injection points#5
see-quick wants to merge 2 commits into
strimzi:mainfrom
see-quick:extract-faul-injection-points-into-dedicated-methods

Conversation

@see-quick
Copy link
Copy Markdown
Member

@see-quick see-quick commented May 15, 2026

This PR extract fault injection points into dedicated util class.

see-quick added 2 commits May 15, 2026 14:04
Signed-off-by: see-quick <maros.orsak159@gmail.com>
Signed-off-by: see-quick <maros.orsak159@gmail.com>
@see-quick see-quick changed the title Extract faul injection points into dedicated methods Extract fault injection points May 15, 2026
@see-quick see-quick requested a review from a team May 15, 2026 12:17
@see-quick see-quick self-assigned this May 15, 2026
@see-quick see-quick added this to the 0.1.0 milestone May 15, 2026
@see-quick see-quick linked an issue May 15, 2026 that may be closed by this pull request
* @param shouldFail whether to throw
* @param exception the exception to throw
*/
static void maybeInjectFailure(boolean shouldFail, RuntimeException exception) {
Copy link
Copy Markdown
Member

@ppatierno ppatierno May 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the case I should call this method with false so it would do nothing, instead of not calling it at all? What's the advantage of not having the caller making such decision?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean like this?

if (config.getBoolean(...)) {
      injectFailure(... ); // here exception ));
}    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract fault injection points into dedicated methods

2 participants