Observable<MyObject>
given()
.accept(MediaType.APPLICATION_JSON_UTF8_VALUE)
.contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)
.body(myContent())
.when()
.async()
.post(BASE_URI)
.then()
.apply(print())
.body("id", equalTo("foo"))
.expect(status().isOk());
--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
MvcResult result = this.mockMvc .perform( post(BASE_URI) .accept(MediaType.APPLICATION_JSON_UTF8) .contentType(MediaType.APPLICATION_JSON_UTF8) .content(myContent()) ) .andDo(print()) .andExpect(status().isOk()) // this is the status code of the MockHttpServletResponse .andReturn();
this.mockMvc.perform(asyncDispatch(result)) .andExpect(status().isOk()) // this is the status code of the Async .andExpect(jsonPath("$.id").value("foo"));Output:MockHttpServletRequest:
HTTP Method = POST
Request URI = /api/my/uri
Parameters = {}
Headers = {Accept=[application/json;charset=UTF-8], Content-Type=[application/json;charset=UTF-8]}
Handler:
Type = com.my.Controller
Method = public rx.Observable<com.my.AggregateId> com.my.Controller.create(java.lang.String,java.lang.String,com.my.Dto)
Async:
Async started = true
Async result = AggregateId(id=foo)
Resolved Exception:
Type = null
ModelAndView:
View name = null
View = null
Model = null
FlashMap:
Attributes = null
MockHttpServletResponse:
Status = 200
Error message = null
Headers = {}
Content type = null
Body =
Forwarded URL = null
Redirected URL = null
Cookies = []
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.