tckBusiness.saveBusiness(authInfoJoe, TOM_BUSINESS545_XML, TOM_BUSINESS545_KEY);
try {
int size = 0;
BusinessList bl = null;
FindBusiness fb = new FindBusiness();
FindQualifiers fqs = new FindQualifiers();
fqs.getFindQualifier().add("combineCategoryBags");
fb.setFindQualifiers(fqs);
KeyedReference keyRef1 = new KeyedReference();
keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
keyRef1.setKeyValue("value-z");
KeyedReference keyRef2 = new KeyedReference();
keyRef2.setTModelKey(TOM_PUBLISHER_TMODEL02_KEY);
keyRef2.setKeyValue("value-x");
KeyedReference keyRef3 = new KeyedReference();
keyRef3.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
keyRef3.setKeyValue("value-y");
CategoryBag cb = new CategoryBag();
cb.getKeyedReference().add(keyRef1);
cb.getKeyedReference().add(keyRef2);
cb.getKeyedReference().add(keyRef3);
fb.setCategoryBag(cb);
bl = inquiry.findBusiness(fb);
if (bl.getBusinessInfos() == null) {
Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
+ "found " + size);
}
size = bl.getBusinessInfos().getBusinessInfo().size();
if (size != 1) {
Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
+ "found " + size);
} else {
List<BusinessInfo> biList = bl.getBusinessInfos().getBusinessInfo();
String businessKey = biList.get(0).getBusinessKey();
if (!BUSINESS_KEY545.equals(businessKey)) {
Assert.fail("Should have found business key " + BUSINESS_KEY545
+ " but found [" + businessKey + "]");
}