CnpjValidator validation is failing for a valid cnpj

Description

Today i found a valid cnpj not passing @CNPJ validation constraint. After digging a little, i realized that all valid cnpj with check digit 0 were failing. Looking at the source of CNPJValidator i found an issue with the configuration of the Mod11CheckValidator, in the initialization an 'X' was supplied as treatCheck10As parameter.
But a valid cnpj doesn't contains 'X' character, in this case a '0' was expected. (the same as CPFValidator).

I've tested against hibernate validator 5.2.0.CR1 and 5.2.0.Alpha1, and both versions were failing.

I've also created a pull request with the test case i found the bug.

Environment

None

Status

Assignee

Hardy Ferentschik

Reporter

Denis Silva

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

Priority

Major
Configure