Had a quick look, the VF type we actually get in the test is LazyValidatorFactory which basically is good news, as it means WFLY-1705 works as expected.
cool.
I think instead of getting the VF from the EM property map (which isn't portable as the comment in the code says) and asserting its type, we e.g. could use a custom XML constraint mapping, persist a test entity and assert the resulting violations raised by JPA lifecycle validation.
I don't think that this is what this test is about. At the very least it is a very indirect way.
That way we're sure validation triggered via JPA obeys to the configuration in META-INF/validation.xml (that's what I think is the purpose of this test).
The purpose is to verify that the custom provider is picked up and the right validator factory is used (DummyValidatorFactory I think in out case). could we not use unwrap and then assert the type? Or we could just call a factory method. I think the dummy throws exceptions which we could assert on.
|