mobilefish

Untitled

Jun 28th, 2019
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. why I get blank in outputResult ? when I test with swagger UI , I get output for the same input.
  2.  
  3. Is this code wrong to get response output ?
  4.  
  5.  
  6. MvcResult result = mvc.perform( MockMvcRequestBuilders
  7. .post("/api")
  8. .content(inputJsonContent)
  9. .contentType(MediaType.APPLICATION_JSON)
  10. .accept(MediaType.APPLICATION_JSON))
  11. .andExpect(status().isOk())
  12. .andReturn();
  13.  
  14. String outputResult= result.getResponse().getContentAsString();
  15. System.out.println("outputResult="+ outputResult);
Add Comment
Please, Sign In to add comment