@Test public void clientIdNullTest() { clientIdInterceptorService.validate( 10L, null); assertEquals(HttpStatus.UNAUTHORIZED.value(), this.ctx.getResponseStatusCode()); assertTrue((Boolean) this.ctx.get(INTERRUPT)); assertFalse(ctx.sendZuulResponse()); }
public void validate(Long apiId, Location location) { RequestContext context = RequestContext.getCurrentContext(); String clientId; if (Location.HEADER.equals(location)) { clientId = context.getZuulRequestHeaders().get(CLIENT_ID); if (clientId == null) clientId = context.getRequest().getHeader(CLIENT_ID); } else clientId = context.getRequest().getParameter(CLIENT_ID); this.validateClientId(apiId, clientId); }
ClientIdInterceptorService { public void validate(Long apiId, Location location) { RequestContext context = RequestContext.getCurrentContext(); String clientId; if (Location.HEADER.equals(location)) { clientId = context.getZuulRequestHeaders().get(CLIENT_ID); if (clientId == null) clientId = context.getRequest().getHeader(CLIENT_ID); } else clientId = context.getRequest().getParameter(CLIENT_ID); this.validateClientId(apiId, clientId); } }
ClientIdInterceptorService { public void validate(Long apiId, Location location) { RequestContext context = RequestContext.getCurrentContext(); String clientId; if (Location.HEADER.equals(location)) { clientId = context.getZuulRequestHeaders().get(CLIENT_ID); if (clientId == null) clientId = context.getRequest().getHeader(CLIENT_ID); } else clientId = context.getRequest().getParameter(CLIENT_ID); this.validateClientId(apiId, clientId); }  }
ClientIdInterceptorService { public void validate(Long apiId, Location location) { RequestContext context = RequestContext.getCurrentContext(); String clientId; if (Location.HEADER.equals(location)) { clientId = context.getZuulRequestHeaders().get(CLIENT_ID); if (clientId == null) clientId = context.getRequest().getHeader(CLIENT_ID); } else clientId = context.getRequest().getParameter(CLIENT_ID); this.validateClientId(apiId, clientId); }  void validate(Long apiId, Location location); }
ClientIdInterceptorService { public void validate(Long apiId, Location location) { RequestContext context = RequestContext.getCurrentContext(); String clientId; if (Location.HEADER.equals(location)) { clientId = context.getZuulRequestHeaders().get(CLIENT_ID); if (clientId == null) clientId = context.getRequest().getHeader(CLIENT_ID); } else clientId = context.getRequest().getParameter(CLIENT_ID); this.validateClientId(apiId, clientId); }  void validate(Long apiId, Location location);  }