ShardingOrderService { public List<ShardingOrder> select(ShardingOrder order) { return dao.select(order); }  List<ShardingOrder> select(ShardingOrder order); @Transactional(readOnly = false) void insert(ShardingOrder order); @Transactional(readOnly = false) void delete(ShardingOrder order);  }
@Test(expected = IndexOutOfBoundsException.class) public void select() throws Exception { List<ShardingOrder> list = shardingOrderService.select(order); Assert.assertTrue(list.get(0).getStatus().equals(STATUS_NAME)); }
@Test public void selectSlave() throws Exception { order.setUserId(11); order.setOrderId(1100); List<ShardingOrder> list = shardingOrderService.select(order); log.info(list.get(0)+""); Assert.assertTrue(list.get(0).getStatus().equals(STATUS_NAME_SLAVE)); }