public class TkTestUtils extends Object
Constructor and Description |
---|
TkTestUtils() |
Modifier and Type | Method and Description |
---|---|
static TimeBlock |
createDummyTimeBlock(org.joda.time.DateTime clockIn,
org.joda.time.DateTime clockOut,
BigDecimal hours,
String earnCode) |
static TimeBlock |
createDummyTimeBlock(org.joda.time.DateTime clockIn,
org.joda.time.DateTime clockOut,
BigDecimal hours,
String earnCode,
Long jobNumber,
Long workArea) |
static TimeBlock |
createTimeBlock(TimesheetDocument timesheetDocument,
int dayInPeriod,
int numHours) |
static TimeBlock |
createTimeBlock(TimesheetDocument timesheetDocument,
int dayInPeriod,
int numHours,
String earnCode) |
static List<TimeBlock> |
createUniformActualTimeBlocks(TimesheetDocument timesheetDocument,
Assignment assignment,
String earnCode,
org.joda.time.DateTime start,
int days,
BigDecimal hours,
BigDecimal amount,
String principalId)
Helper method to generate time blocks suitable for db persistence in
unit tests.
|
static List<TimeBlock> |
createUniformTimeBlocks(org.joda.time.DateTime start,
int days,
BigDecimal hours,
String earnCode,
Long jobNumber,
Long workArea)
Helper method to create regular time blocks for use in testing.
|
static List<TimeBlock> |
createUniformTimeBlocks(org.joda.time.DateTime start,
int days,
BigDecimal hours,
String earnCode,
Long jobNumber,
Long workArea,
Long task) |
static Map<org.joda.time.DateTime,BigDecimal> |
getDateToHoursMap(TimeBlock timeBlock,
TimeHourDetail timeHourDetail) |
static List<Job> |
getJobs(org.joda.time.LocalDate calDate,
String principalId) |
static TimesheetDocument |
populateBlankTimesheetDocument(org.joda.time.DateTime calDate,
String principalId) |
static TimesheetDocument |
populateTimesheetDocument(org.joda.time.DateTime calDate,
String principalId) |
static void |
verifyAggregateHourSums(Map<String,BigDecimal> ecToHoursMap,
TkTimeBlockAggregate aggregate,
int flsaWeek) |
static void |
verifyAggregateHourSums(String msg,
Map<String,BigDecimal> ecToHoursMap,
TkTimeBlockAggregate aggregate,
int flsaWeek)
Helper method to verify that the aggregate contains the correct sums as
indicated in the ecToHoursMapping, on a SINGLE given flsaWeek.
|
static void |
verifyAggregateHourSumsFlatList(String msg,
Map<String,BigDecimal> ecToHoursMap,
TkTimeBlockAggregate aggregate) |
public TkTestUtils()
public static TimesheetDocument populateBlankTimesheetDocument(org.joda.time.DateTime calDate, String principalId)
public static TimesheetDocument populateTimesheetDocument(org.joda.time.DateTime calDate, String principalId)
public static List<TimeBlock> createUniformTimeBlocks(org.joda.time.DateTime start, int days, BigDecimal hours, String earnCode, Long jobNumber, Long workArea)
start
- days
- hours
- earnCode
- jobNumber
- workArea
- public static List<TimeBlock> createUniformTimeBlocks(org.joda.time.DateTime start, int days, BigDecimal hours, String earnCode, Long jobNumber, Long workArea, Long task)
public static TimeBlock createDummyTimeBlock(org.joda.time.DateTime clockIn, org.joda.time.DateTime clockOut, BigDecimal hours, String earnCode)
public static TimeBlock createDummyTimeBlock(org.joda.time.DateTime clockIn, org.joda.time.DateTime clockOut, BigDecimal hours, String earnCode, Long jobNumber, Long workArea)
public static TimeBlock createTimeBlock(TimesheetDocument timesheetDocument, int dayInPeriod, int numHours)
public static TimeBlock createTimeBlock(TimesheetDocument timesheetDocument, int dayInPeriod, int numHours, String earnCode)
public static void verifyAggregateHourSumsFlatList(String msg, Map<String,BigDecimal> ecToHoursMap, TkTimeBlockAggregate aggregate)
public static void verifyAggregateHourSums(String msg, Map<String,BigDecimal> ecToHoursMap, TkTimeBlockAggregate aggregate, int flsaWeek)
ecToHoursMap
- ex: { 'REG' => 40, 'OVT' => 10 }aggregate
- An aggregate object containing the time blocksflsaWeek
- 0 indexed start week (pulling from aggregate)public static void verifyAggregateHourSums(Map<String,BigDecimal> ecToHoursMap, TkTimeBlockAggregate aggregate, int flsaWeek)
public static List<TimeBlock> createUniformActualTimeBlocks(TimesheetDocument timesheetDocument, Assignment assignment, String earnCode, org.joda.time.DateTime start, int days, BigDecimal hours, BigDecimal amount, String principalId)
public static Map<org.joda.time.DateTime,BigDecimal> getDateToHoursMap(TimeBlock timeBlock, TimeHourDetail timeHourDetail)
Copyright © 2004–2015 The Kuali Foundation. All rights reserved.