I am writing test for a Spring Rest Service which redirects the url to another spring service. So the goal is to find the Bookmark using a bookmark name. The first service gets the BookmarkId using the Bookmark name and then it redirects the url to load the object based on the BookmarkId
I can easily test the url redirect using, the below works fine
mockMvc.perform(get("/bookmarks/name/" + "sample"))
.andExpect(status().isMovedPermanently()).andExpect(redirectedUrl("/bookmarks/" + bookmark.getKey()));
what I want is to do the next step and call the next url and load the bookmark object, how do I do that ??