### Question:
WorkspaceIdModifiedRequest extends HttpServletRequestWrapper { @Override public StringBuffer getRequestURL() { StringBuffer requestURL = super.getRequestURL(); Matcher apiResourceMatcher = API_RESOURCE_PATTERN.matcher(requestURL); if (apiResourceMatcher.find()) { return requestURL.replace(apiResourceMatcher.start(), apiResourceMatcher.end(), replaceString); } return requestURL; } WorkspaceIdModifiedRequest(HttpServletRequest request, Long workspaceId); @Override String getRequestURI(); @Override StringBuffer getRequestURL();  }### Answer:
@Test public void testGetURLWithoutWorkspaceId() { when(request.getRequestURL()).thenReturn(new StringBuffer(URL_WITHOUT_WORKSPACE_ID)); assertTrue(StringUtils.equals(URL_WITHOUT_WORKSPACE_ID, underTest.getRequestURL())); }
@Test public void testGetURLWithWorkspace() { when(request.getRequestURL()).thenReturn(new StringBuffer(URL_WITH_DIFFERENT_WORKSPACE_ID)); assertTrue(StringUtils.equals(URL_WITH_TENANT_DEFAULT_WORKSPACE_ID, underTest.getRequestURL())); }