Campaign campaign2 = new Campaign();
campaign2.setId(this.campaign2.getId());
campaign2.setStatus(CampaignStatus.DELETED);
// Create and set budget.
Budget budget = new Budget();
budget.setPeriod(BudgetBudgetPeriod.DAILY);
budget.setAmount(new Money(null, 3000000L));
budget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
campaign1.setBudget(budget);
campaign2.setBudget(budget);
// Create operations.
CampaignOperation operation1 = new CampaignOperation();
operation1.setOperand(campaign1);
operation1.setOperator(Operator.SET);
CampaignOperation operation2 = new CampaignOperation();
operation2.setOperand(campaign2);
operation2.setOperator(Operator.SET);
CampaignOperation[] operations = new CampaignOperation[] {operation1, operation2};
CampaignReturnValue result = campaignService.mutate(operations);
Campaign testCampaign1 = result.getValue()[0];
Campaign testCampaign2 = result.getValue()[1];
// Set the updated fields.
this.campaign1.setStatus(CampaignStatus.DELETED);
budget.getAmount().setComparableValueType(
testCampaign1.getBudget().getAmount().getComparableValueType());
this.campaign1.setBudget(budget);
this.campaign2.setStatus(CampaignStatus.DELETED);
budget.getAmount().setComparableValueType(
testCampaign2.getBudget().getAmount().getComparableValueType());
this.campaign2.setBudget(budget);
// Set the generated fields.
this.campaign1.setCampaignStats(testCampaign1.getCampaignStats());