EngineResource { String mapRequestURI(final String requestURI) { return requestURI.replaceFirst("^/api", ""); }  @RequestMapping("/**") @ResponseBody Object mirrorRest(@RequestBody(required = false) final Object body, final HttpMethod method, final HttpServletRequest request, final HttpServletResponse response);  }
@Test public void testMapRequestURINoMiddleReplacement() { EngineResource sut = new EngineResource(); String actual = sut.mapRequestURI("/api/engine/api/models"); assertThat(actual, equalTo("/engine/api/models")); }
@Test public void testMapRequestURI() { EngineResource sut = new EngineResource(); String actual = sut.mapRequestURI("/api/engine/models"); assertThat(actual, equalTo("/engine/models")); }