@Test(expected = IllegalArgumentException.class) public void shouldThrowAnExceptionForUnknownEventFlag() { final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage = anIEXPriceLevelUpdateMessage() .withIEXEventFlag(null) .build(); final IEXOrderBook orderBook = new IEXOrderBook(TEST_SYMBOL); orderBook.priceLevelUpdate(iexPriceLevelUpdateMessage); }
public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; default: throw new IllegalArgumentException("Unknown Price Level Update type. Cannot process."); } }
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; default: throw new IllegalArgumentException("Unknown Price Level Update type. Cannot process."); } } }
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; default: throw new IllegalArgumentException("Unknown Price Level Update type. Cannot process."); } } IEXOrderBook(final String symbol); }
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; default: throw new IllegalArgumentException("Unknown Price Level Update type. Cannot process."); } } IEXOrderBook(final String symbol); void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage); @Override String getSymbol(); @Override List<PriceLevel> getBidLevels(); @Override List<PriceLevel> getAskLevels(); @Override PriceLevel getBestAskOffer(); @Override PriceLevel getBestBidOffer(); @Override String toString(); }
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; default: throw new IllegalArgumentException("Unknown Price Level Update type. Cannot process."); } } IEXOrderBook(final String symbol); void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage); @Override String getSymbol(); @Override List<PriceLevel> getBidLevels(); @Override List<PriceLevel> getAskLevels(); @Override PriceLevel getBestAskOffer(); @Override PriceLevel getBestBidOffer(); @Override String toString();  }