@Test public void noApp() { this.request.addHeader(CLIENT_ID, clientId1); Api api = new Api(); api.setId(1L); Operation operation = new Operation(1111L, null, null,null, null); Scope scope = new Scope(1000L, null, null, null, null); scope.setOperations(new HashSet<>(Collections.singletonList(operation))); context.set(OPERATION_ID, operation.getId()); context.set(API_ID, api.getId()); Mockito.when(appRepository.findByClientId(Mockito.anyString())).thenReturn(null); this.filter.run(); final FilterDetail filterDetail = TraceContextHolder.getInstance().getActualTrace().getFilters().get(SCOPES_FILTER); assertEquals(HttpStatus.OK.value(), context.getResponseStatusCode()); assertEquals(Constants.SUCCESS, filterDetail.getStatus()); }
@Override public Object run() { long startTime = System.currentTimeMillis(); try { process(); detail.setStatus(Constants.SUCCESS); } catch (Throwable e) { detail.setStatus(Constants.FAILED); throw e; } finally { long endTime = System.currentTimeMillis(); long duration = (endTime - startTime); detail.setTimeInMillisRun(duration); TraceContextHolder.getInstance().getActualTrace().addFilter(this.getClass().getSimpleName(), detail); } return null; }
ScopesFilter extends ZuulFilter { @Override public Object run() { long startTime = System.currentTimeMillis(); try { process(); detail.setStatus(Constants.SUCCESS); } catch (Throwable e) { detail.setStatus(Constants.FAILED); throw e; } finally { long endTime = System.currentTimeMillis(); long duration = (endTime - startTime); detail.setTimeInMillisRun(duration); TraceContextHolder.getInstance().getActualTrace().addFilter(this.getClass().getSimpleName(), detail); } return null; } }
ScopesFilter extends ZuulFilter { @Override public Object run() { long startTime = System.currentTimeMillis(); try { process(); detail.setStatus(Constants.SUCCESS); } catch (Throwable e) { detail.setStatus(Constants.FAILED); throw e; } finally { long endTime = System.currentTimeMillis(); long duration = (endTime - startTime); detail.setTimeInMillisRun(duration); TraceContextHolder.getInstance().getActualTrace().addFilter(this.getClass().getSimpleName(), detail); } return null; }  }
ScopesFilter extends ZuulFilter { @Override public Object run() { long startTime = System.currentTimeMillis(); try { process(); detail.setStatus(Constants.SUCCESS); } catch (Throwable e) { detail.setStatus(Constants.FAILED); throw e; } finally { long endTime = System.currentTimeMillis(); long duration = (endTime - startTime); detail.setTimeInMillisRun(duration); TraceContextHolder.getInstance().getActualTrace().addFilter(this.getClass().getSimpleName(), detail); } return null; }  @Override String filterType(); @Override int filterOrder(); @Override boolean shouldFilter(); @Override Object run(); }
ScopesFilter extends ZuulFilter { @Override public Object run() { long startTime = System.currentTimeMillis(); try { process(); detail.setStatus(Constants.SUCCESS); } catch (Throwable e) { detail.setStatus(Constants.FAILED); throw e; } finally { long endTime = System.currentTimeMillis(); long duration = (endTime - startTime); detail.setTimeInMillisRun(duration); TraceContextHolder.getInstance().getActualTrace().addFilter(this.getClass().getSimpleName(), detail); } return null; }  @Override String filterType(); @Override int filterOrder(); @Override boolean shouldFilter(); @Override Object run();  }