@Test
public void testGetAlloted() {
Locale locale = Locale.US;
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.MONTH, 6);
Budget budget = new Budget();
MonthlyBudget monthlyBudget = new MonthlyBudget();
monthlyBudget.setBudgetedMonth(6);
CategoryBudget categoryBudget = new CategoryBudget();
CategoryBudget categoryBudget2 = new CategoryBudget();
Subcategory subcategory = Subcategory.findSubcategory(1L);
Subcategory subcategory2 = Subcategory.findSubcategory(3L);
categoryBudget.setLocale(locale);
categoryBudget2.setLocale(locale);
categoryBudget.setCategory(subcategory);
categoryBudget2.setCategory(subcategory2);
categoryBudget.setExpectedAmount(BigDecimal.TEN);
categoryBudget2.setExpectedAmount(BigDecimal.TEN);
categoryBudget.setMonthlyBudget(monthlyBudget);
monthlyBudget.setBudget(budget);
monthlyBudget.getBudgets().add(categoryBudget);
monthlyBudget.getBudgets().add(categoryBudget2);
budget.getMonthlyBudgets().add(monthlyBudget);
assertEquals("Ten", BigDecimal.TEN, budget.getAlloted(calendar.getTime(), locale, subcategory));
}