SyntaxFix
Write A Post
Hire A Developer
Questions
String body = mockMvc.perform(bla... bla).andReturn().getResolvedException().getMessage()
This should give you the body of the response. "Username already taken" in your case.