private void givenResource(boolean relatedWithCostCategory) {
resource = Worker.createUnvalidated("default-resource" + UUID.randomUUID(),
"default-resource", "default-resource", "default-resource");
if (relatedWithCostCategory) {
ResourcesCostCategoryAssignment resourcesCostCategoryAssignment = ResourcesCostCategoryAssignment
.create();
resourcesCostCategoryAssignment.setCode("resources-cost-category-assignment"
+ UUID.randomUUID());
resourcesCostCategoryAssignment.setCostCategory(costCategory);
resourcesCostCategoryAssignment.setInitDate(new LocalDate());
resource.addResourcesCostCategoryAssignment(resourcesCostCategoryAssignment);
}
resourceDAO.save(resource);
}