@Transactional
public void testAddMaterialCategoryWithSameName() {
/* Build material (0 constraint violations). */
MaterialCategoryDTO mc1 = new MaterialCategoryDTO("subMC1",
"subCategory", "subMC2", null, null);
MaterialCategoryListDTO subCategoryListDTOC = createMaterialCategoryListDTO(mc1);
MaterialCategoryDTO mc2 = new MaterialCategoryDTO("subMC2",
"subCategory", null, subCategoryListDTOC, null);
MaterialCategoryListDTO subCategoryListDTOB = createMaterialCategoryListDTO(mc2);
/* Build main material category */
MaterialCategoryDTO materialCategoryDTO = new MaterialCategoryDTO(
"mainMaterialCode", "mainCategory1", null, subCategoryListDTOB,
null);
MaterialCategoryListDTO materialCategoryListDTOA = createMaterialCategoryListDTO(materialCategoryDTO);
List<InstanceConstraintViolationsDTO> instanceConstraintViolationsList = materialService
.addMaterials(materialCategoryListDTOA).instanceConstraintViolationsList;
assertTrue(instanceConstraintViolationsList.toString(),