@Test public void atStartTradingIsDeactivated() { cut.sendOrder(someOrder, someEventListener); verify(someEventListener).orderRejected(any()); verifyNoMoreInteractions(broker); }
@Override public OrderManagement sendOrder(final BasicPendingOrder order, final OrderEventListener eventListener) { if (activated) { return broker.sendOrder(order, eventListener); } else { eventListener.orderRejected(TRADING_BLOCKED); return NO_OP_ORDER_MANAGEMENT; } }
DeactivateableBroker implements Broker<BasicPendingOrder> { @Override public OrderManagement sendOrder(final BasicPendingOrder order, final OrderEventListener eventListener) { if (activated) { return broker.sendOrder(order, eventListener); } else { eventListener.orderRejected(TRADING_BLOCKED); return NO_OP_ORDER_MANAGEMENT; } } }
DeactivateableBroker implements Broker<BasicPendingOrder> { @Override public OrderManagement sendOrder(final BasicPendingOrder order, final OrderEventListener eventListener) { if (activated) { return broker.sendOrder(order, eventListener); } else { eventListener.orderRejected(TRADING_BLOCKED); return NO_OP_ORDER_MANAGEMENT; } } DeactivateableBroker(final Broker<BasicPendingOrder> broker); }
DeactivateableBroker implements Broker<BasicPendingOrder> { @Override public OrderManagement sendOrder(final BasicPendingOrder order, final OrderEventListener eventListener) { if (activated) { return broker.sendOrder(order, eventListener); } else { eventListener.orderRejected(TRADING_BLOCKED); return NO_OP_ORDER_MANAGEMENT; } } DeactivateableBroker(final Broker<BasicPendingOrder> broker); @Override OrderManagement sendOrder(final BasicPendingOrder order,
                                     final OrderEventListener eventListener); void activate(); void deactivate(); }
DeactivateableBroker implements Broker<BasicPendingOrder> { @Override public OrderManagement sendOrder(final BasicPendingOrder order, final OrderEventListener eventListener) { if (activated) { return broker.sendOrder(order, eventListener); } else { eventListener.orderRejected(TRADING_BLOCKED); return NO_OP_ORDER_MANAGEMENT; } } DeactivateableBroker(final Broker<BasicPendingOrder> broker); @Override OrderManagement sendOrder(final BasicPendingOrder order,
                                     final OrderEventListener eventListener); void activate(); void deactivate();  }