Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator doesn't throw UnexpectedTypeException in retry #361

Open
mancze opened this issue May 13, 2024 · 0 comments
Open

Validator doesn't throw UnexpectedTypeException in retry #361

mancze opened this issue May 13, 2024 · 0 comments

Comments

@mancze
Copy link

mancze commented May 13, 2024

Expected Behavior

This is based on what was reported in #312 (it is also mentioned in the Steps to Reproduce in the linked issue - difference in behaviour is described between step 5 and 7). Validator behaviour should be consistent in a subsequent calls.

Actual Behaviour

Given the misconfigured validation annotation (extra @Constraint(validatedBy = {}) when there is no factory: #312 (comment)):

@Constraint(validatedBy = {})
public @interface ValidInternalId {
}

Validator throws only for the first call:

try {
	// first try - throws
	assertThat(validator.validate(bean)).isEmpty();
} catch (Exception e) {
	// retry - works
	assertThat(validator.validate(bean)).isEmpty();
}

Expectation is that same exception should be thrown in the second call in a retry block.

Steps To Reproduce

No response

Environment Information

No response

Example Application

https://github.com/mancze/micronaut-sandbox/tree/repro/constraint-validation-not-foundhttps://github.com/mancze/micronaut-sandbox/tree/repro/constraint-validation-not-found

Version

4.3.8

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

No branches or pull requests

1 participant