Skip to content

Commit

Permalink
GH-1 fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffnelson committed Dec 4, 2019
1 parent 6089aab commit d064673
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

package com.github.jeffnelson.jackson.patch.validator;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
Expand Down Expand Up @@ -110,13 +110,9 @@ public void testPatchFoo_someInvalid() throws Exception {
.content(content)
.contentType(PatchMediaType.APPLICATION_MERGE_PATCH_JSON))
.andExpect(status().is4xxClientError())

.andExpect(jsonPath("[*].field", is("myDbl")))
.andExpect(jsonPath("[*].error", is("must be less than or equal to 50")))
.andExpect(jsonPath("[*].field", is("myLong")))
.andExpect(jsonPath("[*].error", is("Required")))
.andExpect(jsonPath("[*].field", is("myInt")))
.andExpect(jsonPath("[*].error", is("must be greater than or equal to 12")))
.andExpect(jsonPath("$.[?(@.field == 'myDbl')].error", hasItem("must be less than or equal to 50")))
.andExpect(jsonPath("$.[?(@.field == 'myLong')].error", hasItem("Required")))
.andExpect(jsonPath("$.[?(@.field == 'myInt')].error", hasItem("must be greater than or equal to 12")))
.andReturn();

assertNull(controller.foo);
Expand Down

0 comments on commit d064673

Please sign in to comment.