当前位置: 首页>>代码示例>>Java>>正文


Java EasyMock.getCurrentArguments方法代码示例

本文整理汇总了Java中org.easymock.classextension.EasyMock.getCurrentArguments方法的典型用法代码示例。如果您正苦于以下问题:Java EasyMock.getCurrentArguments方法的具体用法?Java EasyMock.getCurrentArguments怎么用?Java EasyMock.getCurrentArguments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.easymock.classextension.EasyMock的用法示例。


在下文中一共展示了EasyMock.getCurrentArguments方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAddItemToFulfillmentGroupAnswer

import org.easymock.classextension.EasyMock; //导入方法依赖的package包/类
public static IAnswer<FulfillmentGroup> getAddItemToFulfillmentGroupAnswer() {
    return new IAnswer<FulfillmentGroup>() {
        @Override
        public FulfillmentGroup answer() throws Throwable {
            FulfillmentGroupItemRequest fgItemRequest = (FulfillmentGroupItemRequest) EasyMock.getCurrentArguments()[0];
            FulfillmentGroup fg = fgItemRequest.getFulfillmentGroup();
            FulfillmentGroupItem fgItem = new FulfillmentGroupItemImpl();
            fgItem.setOrderItem(fgItemRequest.getOrderItem());
            fgItem.setQuantity(fgItemRequest.getQuantity());
            fg.getFulfillmentGroupItems().add(fgItem);
            
            return fg;
        }
    };
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:16,代码来源:OfferDataItemProvider.java

示例2: getAddOrderItemToOrderAnswer

import org.easymock.classextension.EasyMock; //导入方法依赖的package包/类
public static IAnswer<OrderItem> getAddOrderItemToOrderAnswer() {
    return new IAnswer<OrderItem>() {
        @Override
        public OrderItem answer() throws Throwable {
            Order order = (Order) EasyMock.getCurrentArguments()[0];
            order.getOrderItems().add((OrderItem) EasyMock.getCurrentArguments()[1]);
            if (((OrderItem) EasyMock.getCurrentArguments()[1]).getId() == null) {
                ((OrderItem) EasyMock.getCurrentArguments()[1]).setId(OfferDataItemProvider.getOrderItemId());
            }
            return (OrderItem) EasyMock.getCurrentArguments()[1];
        }
    };
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:14,代码来源:OfferDataItemProvider.java

示例3: getSaveOrderItemAnswer

import org.easymock.classextension.EasyMock; //导入方法依赖的package包/类
public static IAnswer<OrderItem> getSaveOrderItemAnswer() {
    return new IAnswer<OrderItem>() {
        @Override
        public OrderItem answer() throws Throwable {
            OrderItem orderItem = (OrderItem) EasyMock.getCurrentArguments()[0];
            if (orderItem.getId() == null) {
                orderItem.setId(getOrderItemId());
            }
            return orderItem;
        }
    };
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:13,代码来源:OfferDataItemProvider.java

示例4: getSaveOrderAnswer

import org.easymock.classextension.EasyMock; //导入方法依赖的package包/类
public static IAnswer<Order> getSaveOrderAnswer() {
    return new IAnswer<Order>() {
        @Override
        public Order answer() throws Throwable {
            Order order = (Order) EasyMock.getCurrentArguments()[0];
            order.setId(getOrderId());
            orders.put(order.getId(), order);
            return order;
        }
    };
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:12,代码来源:OfferDataItemProvider.java

示例5: getSameOrderAnswer

import org.easymock.classextension.EasyMock; //导入方法依赖的package包/类
public static IAnswer<Order> getSameOrderAnswer() {
    return new IAnswer<Order>() {
        @Override
        public Order answer() throws Throwable {
            return (Order) EasyMock.getCurrentArguments()[0];
        }
    };
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:9,代码来源:OfferDataItemProvider.java

示例6: getSaveFulfillmentGroupItemAnswer

import org.easymock.classextension.EasyMock; //导入方法依赖的package包/类
public static IAnswer<FulfillmentGroupItem> getSaveFulfillmentGroupItemAnswer() {
    return new IAnswer<FulfillmentGroupItem>() {
        @Override
        public FulfillmentGroupItem answer() throws Throwable {
            return (FulfillmentGroupItem) EasyMock.getCurrentArguments()[0];
        }
    };
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:9,代码来源:OfferDataItemProvider.java

示例7: getRemoveItemFromOrderAnswer

import org.easymock.classextension.EasyMock; //导入方法依赖的package包/类
public static IAnswer<Order> getRemoveItemFromOrderAnswer() {
    return new IAnswer<Order>() {
        @Override
        public Order answer() throws Throwable {
            Long orderId = (Long) EasyMock.getCurrentArguments()[0];
            Order order = orders.get(orderId);
            
            Iterator<OrderItem> orderItemItr = order.getOrderItems().listIterator();
            while (orderItemItr.hasNext()) {
                OrderItem item = orderItemItr.next();
                if (item.getId().equals(EasyMock.getCurrentArguments()[1])) {
                    orderItemItr.remove();
                }
            }
            
            for (FulfillmentGroup fg : order.getFulfillmentGroups()) {
                Iterator<FulfillmentGroupItem> itr = fg.getFulfillmentGroupItems().iterator();
                while (itr.hasNext()) {
                    if (itr.next().getOrderItem().getId().equals(EasyMock.getCurrentArguments()[1])) {
                        itr.remove();
                    }
                }
            }
            return order;
        }
    };
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:28,代码来源:OfferDataItemProvider.java


注:本文中的org.easymock.classextension.EasyMock.getCurrentArguments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。