@Test public void betterStatusDoesntTrigger() { QoSProcessor processor = new QoSProcessor(trigger, Status.WARN, wrappedProcessor); when(trigger.getStatus()).thenReturn(Status.OK); processor.invoke(null, null, null); verify(wrappedProcessor, times(0)).invoke(any(ExecutionContext.class), any(OperationKey.class), any(Object[].class)); }
@Override public InterceptorResult invoke(ExecutionContext ctx, OperationKey key, Object[] args) { if (trigger.getStatus().ordinal() >= triggeringStatus.ordinal()) { return processor.invoke(ctx, key, args); } return new InterceptorResult(InterceptorState.CONTINUE); }
QoSProcessor implements ExecutionPreProcessor { @Override public InterceptorResult invoke(ExecutionContext ctx, OperationKey key, Object[] args) { if (trigger.getStatus().ordinal() >= triggeringStatus.ordinal()) { return processor.invoke(ctx, key, args); } return new InterceptorResult(InterceptorState.CONTINUE); } }
QoSProcessor implements ExecutionPreProcessor { @Override public InterceptorResult invoke(ExecutionContext ctx, OperationKey key, Object[] args) { if (trigger.getStatus().ordinal() >= triggeringStatus.ordinal()) { return processor.invoke(ctx, key, args); } return new InterceptorResult(InterceptorState.CONTINUE); } QoSProcessor(StatusSource trigger, Status triggeringStatus, ExecutionPreProcessor processor); }
QoSProcessor implements ExecutionPreProcessor { @Override public InterceptorResult invoke(ExecutionContext ctx, OperationKey key, Object[] args) { if (trigger.getStatus().ordinal() >= triggeringStatus.ordinal()) { return processor.invoke(ctx, key, args); } return new InterceptorResult(InterceptorState.CONTINUE); } QoSProcessor(StatusSource trigger, Status triggeringStatus, ExecutionPreProcessor processor); @Override ExecutionRequirement getExecutionRequirement(); @Override InterceptorResult invoke(ExecutionContext ctx, OperationKey key, Object[] args); @Override String getName(); }
QoSProcessor implements ExecutionPreProcessor { @Override public InterceptorResult invoke(ExecutionContext ctx, OperationKey key, Object[] args) { if (trigger.getStatus().ordinal() >= triggeringStatus.ordinal()) { return processor.invoke(ctx, key, args); } return new InterceptorResult(InterceptorState.CONTINUE); } QoSProcessor(StatusSource trigger, Status triggeringStatus, ExecutionPreProcessor processor); @Override ExecutionRequirement getExecutionRequirement(); @Override InterceptorResult invoke(ExecutionContext ctx, OperationKey key, Object[] args); @Override String getName();  }