Class MockMvcResultMatchers
java.lang.Object
com.codename1.backend.test.MockMvcResultMatchers
The expectations andExpect(...) takes, for static import:
mvc.perform(get("/pets/7"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
.andExpect(jsonPath("$.name").value("Rex"));
-
Method Summary
Modifier and TypeMethodDescriptionstatic ContentResultMatcherscontent()static CookieResultMatcherscookie()static HeaderResultMatchersheader()static JsonPathResultMatchersA JSONPath into the JSON body:$.name,$.items[0].id,$.items[*].id,$['odd key'],$.items.length().static ResultMatcherredirectedUrl(String expected) The response redirects to exactly this location.static StatusResultMatchersstatus()
-
Method Details
-
status
-
content
-
header
-
cookie
-
jsonPath
A JSONPath into the JSON body:$.name,$.items[0].id,$.items[*].id,$['odd key'],$.items.length(). Each%sin the expression takes the next ofargs. -
redirectedUrl
The response redirects to exactly this location.
-