-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Handle upgrade of hibernate-validator from 6.1.7.Final to 7.0.1.Final #1286
Comments
@nya-elimuai I upgraded the version locally but don't see any test errors. Is there a test that should fail to demonstrate the issue with upgrading? |
@macdude357 Apologies for lack of details in this issue. So let me help you out with a little information 🙂 One way to test this error is to launch the webapp, go to http://localhost:8080/webapp/content/word/list, and then adding a new Word without including any of the compulsory fields (those marked with Here is how to reproduce:
And your point about unit tests not failing is a good one. Actually, we should add a couple of unit tests to cover this specific issue. By for example trying to store a CC @UmenR |
As a related topic, also note that Hibernate validation is currently not working in our @Test
public void testHandleSubmit_emptyText() throws Exception {
RequestBuilder requestBuilder = MockMvcRequestBuilders
.post("/content/word/create")
.param("timeStart", String.valueOf(System.currentTimeMillis()))
.param("text", "")
.contentType(MediaType.APPLICATION_FORM_URLENCODED_VALUE);
// MvcResult mvcResult = mockMvc.perform(requestBuilder).andReturn();
// assertEquals(HttpStatus.BAD_REQUEST.value(), mvcResult.getResponse().getStatus());
// assertEquals("content/word/create", mvcResult.getModelAndView().getViewName());
} More info here: https://stackoverflow.com/questions/24049480/spring-mockmvc-doesnt-consider-validation-in-my-test |
This version of the hibernate-validator will result in validation to stop working, so we need to handle this before bumping the version.
@NotNull
and@NotEmpty
.@NotNull
/@NotEmpty
properties.@Ignore
annotation from this unit test: https://github.com/elimu-ai/webapp/blob/master/src/test/java/ai/elimu/dao/ContributorDaoTest.java#L26See https://hibernate.org/validator/documentation/migration-guide/
Relates to #1211
The text was updated successfully, but these errors were encountered: