@Test
public void routeWithoutApiBasePath() {

    this.request.setRequestURI("/v2/api/foo/1");
    this.request.setMethod(HttpMethod.GET.name());
    Map<String, ZuulRoute> routes = new LinkedHashMap<>();
    ZuulRoute route = new ZuulRoute("idFoo", "/v2/api/foo/{id}", null, "my.dns.com.br", true, null, Collections.newSetFromMap(new ConcurrentHashMap<>()));
    routes.put("/v2/api/foo/{id}", route);
    EnvironmentInfo environmentInfo = new EnvironmentInfo();
    environmentInfo.setId(1L);
    environmentInfo.setOutboundURL("http://outbound:8080");
    environmentInfo.setVariables(new HashMap<>());
    Credential opPost = new Credential(HttpMethod.POST.name(), "/api/foo", "/v2", "apiName", 10L, 88L, 10L, false);
    Credential opGet = new Credential(HttpMethod.GET.name(), "/api/foo/{id}", "/v2", "apiName", 10L, 88L, 10L, false);
    Credential opDelete = new Credential(HttpMethod.DELETE.name(), "/api/foo/{id}", "/v2", "apiName", 10L, 88L, 10L, false);
    Mockito.when(routeLocator.getAtomicRoutes()).thenReturn(new AtomicReference<>(routes));
    Mockito.when(credentialRepository.findByPattern("/v2/api/foo/{id}")).thenReturn(Lists.newArrayList(opPost, opGet, opDelete));
    Mockito.when(environmentInfoRepository.findByApiIdAndEnvironmentInboundURL(10L, "http://localhost/v2/api/foo/1")).thenReturn(environmentInfo);
    this.filter.run();
    assertEquals("/api/foo/1", this.ctx.get(REQUEST_URI_KEY));
    assertTrue(this.ctx.sendZuulResponse());
}