@Test
public void throwNotAllowedRoute() {

    this.request.setRequestURI("/v2/api/foo/1");
    this.request.setMethod(HttpMethod.DELETE.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);
    Credential opGet = new Credential(HttpMethod.GET.name(), "/api/foo/{id}", "/path", "apiName", 10L, 88L, 10L, false);
    Mockito.when(routeLocator.getAtomicRoutes()).thenReturn(new AtomicReference<>(routes));
    Mockito.when(credentialRepository.findByPattern("/v2/api/foo/{id}")).thenReturn(Lists.newArrayList(opGet));
    this.filter.run();
    assertFalse(this.ctx.sendZuulResponse());
    assertEquals(HttpStatus.METHOD_NOT_ALLOWED.value(), this.ctx.getResponseStatusCode());
    assertEquals(HttpStatus.METHOD_NOT_ALLOWED.getReasonPhrase(), this.ctx.getResponseBody());
}