本文整理汇总了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;
}
};
}
示例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];
}
};
}
示例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;
}
};
}
示例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;
}
};
}
示例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];
}
};
}
示例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];
}
};
}
示例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;
}
};
}