0

I written test mockMVC method get

i have this following bug

what is bad in my code? what i can fixed it?

martine
  • 79
  • 2
  • 3
  • 10
  • Post the return Json after service call. Is it a flat structure like {"version":"2.0"} and are all json fields present. – Art May 19 '18 at 21:38

1 Answers1

0

It looks like your controller returns an empty response according to the line

Caused by: java.lang.IllegalArgumentException: json can not be null or empty

in your stacktrace. Try to debug the controller code and find out what it returns and why.

tine
  • 40
  • 1
  • @GetMapping(value = "/{id}") @ApiOperation(value = "Retrieve account.") public @ResponseBody ResponseEntity getAccount(@PathVariable Long id) { return accountService.retreiveById(id).map(ResponseEntity::ok) .orElseGet(() -> ResponseEntity.notFound().build()); } – martine May 20 '18 at 07:58
  • this is method get of controller – martine May 20 '18 at 07:59