[Bug #1139] Fix several tests due to new constraint in defaultPrice
FEA: ItEr75S04BugFixing
This commit is contained in:
parent
5886585908
commit
bb41783930
6 changed files with 12 additions and 0 deletions
|
|
@ -105,6 +105,7 @@ public class CostCategoryDAOTest {
|
|||
CostCategory costCategory = createValidCostCategory();
|
||||
TypeOfWorkHours type1 = TypeOfWorkHours.create(UUID.randomUUID().toString(),
|
||||
UUID.randomUUID().toString());
|
||||
type1.setDefaultPrice(BigDecimal.TEN);
|
||||
typeOfWorkHoursDAO.save(type1);
|
||||
HourCost hourCost1 = HourCost.create(BigDecimal.ONE, new LocalDate(2009, 11,1));
|
||||
hourCost1.setType(type1);
|
||||
|
|
@ -130,6 +131,7 @@ public class CostCategoryDAOTest {
|
|||
|
||||
TypeOfWorkHours type2 = TypeOfWorkHours.create(UUID.randomUUID().toString(),
|
||||
UUID.randomUUID().toString());
|
||||
type2.setDefaultPrice(BigDecimal.TEN);
|
||||
typeOfWorkHoursDAO.save(type2);
|
||||
hourCost2.setType(type2);
|
||||
hourCost2.setInitDate(new LocalDate(2009,10,15));
|
||||
|
|
@ -179,8 +181,10 @@ public class CostCategoryDAOTest {
|
|||
CostCategory costCategory = createValidCostCategory();
|
||||
TypeOfWorkHours type1 = TypeOfWorkHours.create(UUID.randomUUID().toString(),
|
||||
UUID.randomUUID().toString());
|
||||
type1.setDefaultPrice(BigDecimal.TEN);
|
||||
TypeOfWorkHours type2 = TypeOfWorkHours.create(UUID.randomUUID().toString(),
|
||||
UUID.randomUUID().toString());
|
||||
type2.setDefaultPrice(BigDecimal.TEN);
|
||||
//types have to be saved before using them
|
||||
//otherwise, the overlapping validation will fail
|
||||
typeOfWorkHoursDAO.save(type1);
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ public class HourCostDAOTest {
|
|||
|
||||
TypeOfWorkHours type =
|
||||
TypeOfWorkHours.create(UUID.randomUUID().toString(), UUID.randomUUID().toString());
|
||||
type.setDefaultPrice(BigDecimal.TEN);
|
||||
hourCost.setType(type);
|
||||
typeOfWorkHoursDAO.save(type);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import static org.junit.Assert.assertTrue;
|
|||
import static org.navalplanner.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
|
||||
import static org.navalplanner.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -64,6 +65,7 @@ public class TypeOfWorkHoursDAOTest {
|
|||
private TypeOfWorkHours createValidTypeOfWorkHours() {
|
||||
TypeOfWorkHours typeOfWorkHours =
|
||||
TypeOfWorkHours.create(UUID.randomUUID().toString(), UUID.randomUUID().toString());
|
||||
typeOfWorkHours.setDefaultPrice(BigDecimal.TEN);
|
||||
return typeOfWorkHours;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
package org.navalplanner.business.test.workreports.daos;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
|
@ -92,6 +93,7 @@ public abstract class AbstractWorkReportTest {
|
|||
private TypeOfWorkHours createValidTypeOfWorkHours() {
|
||||
TypeOfWorkHours typeOfWorkHours = TypeOfWorkHours.create(UUID
|
||||
.randomUUID().toString(), UUID.randomUUID().toString());
|
||||
typeOfWorkHours.setDefaultPrice(BigDecimal.TEN);
|
||||
typeOfWorkHoursDAO.save(typeOfWorkHours);
|
||||
return typeOfWorkHours;
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ public class CostCategoryServiceTest {
|
|||
|
||||
typeOfWorkHours.setCode(code);
|
||||
typeOfWorkHours.setName("name" + UUID.randomUUID());
|
||||
typeOfWorkHours.setDefaultPrice(BigDecimal.TEN);
|
||||
|
||||
typeOfWorkHoursDAO.save(typeOfWorkHours);
|
||||
typeOfWorkHoursDAO.flush();
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import static org.navalplanner.web.WebappGlobalNames.WEBAPP_SPRING_SECURITY_CONF
|
|||
import static org.navalplanner.web.test.WebappGlobalNames.WEBAPP_SPRING_CONFIG_TEST_FILE;
|
||||
import static org.navalplanner.web.test.WebappGlobalNames.WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -205,6 +206,7 @@ public class WorkReportServiceTest {
|
|||
TypeOfWorkHours typeOfWorkHours = TypeOfWorkHours.create();
|
||||
typeOfWorkHours.setCode(typeOfWorkHoursCode);
|
||||
typeOfWorkHours.setName("type-of-work-hours-name-" + UUID.randomUUID());
|
||||
typeOfWorkHours.setDefaultPrice(BigDecimal.TEN);
|
||||
|
||||
typeOfWorkHoursDAO.save(typeOfWorkHours);
|
||||
typeOfWorkHoursDAO.flush();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue