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 · May be fixed by #448
Open

Validator doesn't throw UnexpectedTypeException in retry #361

mancze opened this issue May 13, 2024 · 0 comments · May be fixed by #448

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

altro3 added a commit to altro3/micronaut-validation that referenced this issue Nov 12, 2024
altro3 added a commit to altro3/micronaut-validation that referenced this issue Nov 12, 2024
altro3 added a commit to altro3/micronaut-validation that referenced this issue Nov 12, 2024
altro3 added a commit to altro3/micronaut-validation that referenced this issue Nov 12, 2024
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 a pull request may close this issue.

1 participant