MessageProcessor createCategoryFlow = lookupFlowConstruct("create-category");
MuleEvent res = createCategoryFlow.process(getTestEvent(testObjects));
Integer categoryId = (Integer) res.getMessage().getPayload();
testObjects.put("categoryId", categoryId);
CatalogProductCreateEntity catalogProductCreateEntity = (CatalogProductCreateEntity) testObjects.get("attributesRef");
catalogProductCreateEntity.setCategory_ids(new String[] { String.valueOf(categoryId) } );
MessageProcessor createProductFlow = lookupFlowConstruct("create-product");
MuleEvent res2 = createProductFlow.process(getTestEvent(testObjects));
Integer productId = (Integer) res2.getMessage().getPayload();
testObjects.put("productId", productId);