Package org.mule.api.processor

Examples of org.mule.api.processor.MessageProcessor.process()


  public void testListOrders_NoFilter() {
    try {
      List<String> orderIds = (List<String>) testObjects.get("orderIds");
     
      MessageProcessor flow = lookupFlowConstruct("list-orders-unfiltered");
      MuleEvent response = flow.process(getTestEvent(testObjects));
     
      List<SalesOrderListEntity> orders = (List<SalesOrderListEntity>) response.getMessage().getPayload();
      assertTrue(orders.size() == orderIds.size());
      for (SalesOrderListEntity order : orders) {
        assertTrue(orderIds.contains(order.getIncrement_id()));
View Full Code Here


      String filter = (String) testObjects.get("pendingOrdersFilter");
      testObjects.put("filter", filter);
     
      MessageProcessor flow = lookupFlowConstruct("list-orders");
      MuleEvent response = flow.process(getTestEvent(testObjects));
     
      List<SalesOrderListEntity> orders = (List<SalesOrderListEntity>) response.getMessage().getPayload();
      assertTrue(orders.size() == orderIds.size());
      for (SalesOrderListEntity order : orders) {
        assertTrue(orderIds.contains(order.getIncrement_id()));
View Full Code Here

    try {
      String filter = (String) testObjects.get("cancelledOrdersFilter");
      testObjects.put("filter", filter);
           
      MessageProcessor flow = lookupFlowConstruct("list-orders");
      MuleEvent response = flow.process(getTestEvent(testObjects));
     
      List<SalesOrderListEntity> orders = (List<SalesOrderListEntity>) response.getMessage().getPayload();
      assertTrue(orders.isEmpty());
    }
    catch (Exception e) {
View Full Code Here

    try {
      String filter = (String) testObjects.get("completedOrdersFilter");
      testObjects.put("filter", filter);
     
      MessageProcessor flow = lookupFlowConstruct("list-orders");
      MuleEvent response = flow.process(getTestEvent(testObjects));
     
      List<SalesOrderListEntity> orders = (List<SalesOrderListEntity>) response.getMessage().getPayload();
      assertTrue(orders.isEmpty());
    }
    catch (Exception e) {
View Full Code Here

  @Category({RegressionTests.class})
  @Test
  public void testGetOrderShipmentCarriers() {
    try {
      MessageProcessor flow = lookupFlowConstruct("get-order-shipment-carriers");
      MuleEvent response = flow.process(getTestEvent(testObjects));

      List<Carrier> carriers = (List<Carrier>) response.getMessage().getPayload();
      assertNotNull(carriers);
      for (Carrier carrier : carriers) {
        assertNotNull(carrier.getCode());
View Full Code Here

  @Category({RegressionTests.class})
  @Test
  public void testListShoppingCartShippingMethods() {
    try {
      MessageProcessor flow = lookupFlowConstruct("list-shopping-cart-shipping-methods");
      MuleEvent response = flow.process(getTestEvent(testObjects));
     
      List<ShoppingCartShippingMethodEntity> shippingMethods = (List<ShoppingCartShippingMethodEntity>) response.getMessage().getPayload();
      assertNotNull(shippingMethods);
      for (ShoppingCartShippingMethodEntity method : shippingMethods) {
        assertNotNull(method);
View Full Code Here

  public void setUp() {
    try {
      testObjects = (HashMap<String, Object>) context
          .getBean("listProductAttributeOptions");
      MessageProcessor listProductAttributesFlow = lookupFlowConstruct("list-product-attributes");
      MuleEvent event = listProductAttributesFlow.process(getTestEvent(testObjects));
      List<CatalogAttributeEntity> catalogAttributeEntities = (List<CatalogAttributeEntity>) event.getMessage().getPayload();
      testObjects.put("attributeId", catalogAttributeEntities.get(0).getAttribute_id());
    } catch (Exception e) {
      e.printStackTrace();
      fail();
View Full Code Here

  @Category({RegressionTests.class })
  @Test
  public void testListProductAttributes() {
    try {
      MessageProcessor flow = lookupFlowConstruct("list-product-attribute-options");
      MuleEvent response = flow.process(getTestEvent(testObjects));
     
      List<CatalogAttributeOptionEntity> catalogAttributeOptionEntities = (List<CatalogAttributeOptionEntity>) response
          .getMessage().getPayload();
      assertNotNull(catalogAttributeOptionEntities);
    } catch (Exception e) {
View Full Code Here

  public void testGetOrderInvoice() {
    try {
      String invoiceId = testObjects.get("invoiceId").toString();
     
      MessageProcessor flow = lookupFlowConstruct("get-order-invoice");
      MuleEvent response = flow.process(getTestEvent(testObjects));
     
      SalesOrderInvoiceEntity invoice = (SalesOrderInvoiceEntity) response.getMessage().getPayload();
      assertTrue(invoice.getIncrement_id().equals(invoiceId));
    }
    catch (Exception e) {
View Full Code Here

  @Category({SmokeTests.class, RegressionTests.class})
  @Test
  public void testHoldOrder() {
    try {
      MessageProcessor flow = lookupFlowConstruct("hold-order");
      MuleEvent response = flow.process(getTestEvent(testObjects));
     
      Boolean result = (Boolean) response.getMessage().getPayload();
      assertTrue(result);
    }
    catch (Exception e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.