*/
public void testOfferCreationOnMultipleShardsWithAbnormalOfferService() {
String selectSqlActionTwo = "com.alibaba.cobar.client.entities.Offer.findByMemberId";
for (Long mid : memberIds) {
Offer parameter = new Offer();
parameter.setMemberId(mid);
Offer offer = (Offer) getSqlMapClientTemplate().queryForObject(selectSqlActionTwo,
parameter);
assertNull(offer);
}
try {
Object offerService = getApplicationContext().getBean("abnormalOfferService");
assertTrue(offerService instanceof Proxy);
((IOfferService) offerService)
.createOffersInBatch(createOffersWithMemberIdsFrom(memberIds));
fail();
} catch (RuntimeException e) {
// pass
}
for (Long mid : memberIds) {
Offer parameter = new Offer();
parameter.setMemberId(mid);
assertNull(getSqlMapClientTemplate().queryForObject(selectSqlActionTwo, parameter));
}
}