forked from approvals/ApprovalTests.Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKitchenScheduler.java
More file actions
31 lines (27 loc) · 835 Bytes
/
KitchenScheduler.java
File metadata and controls
31 lines (27 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.spun.util.persistence;
import com.spun.util.io.FileUtils;
import com.spun.util.velocity.VelocityParser;
import java.util.Calendar;
import java.util.List;
public class KitchenScheduler
{
// begin-snippet: entry_point_production
// Called by production code
public static String print(Calendar day)
// end-snippet
{
return print(new LoadShiftsFromDatabase(day), day);
}
// begin-snippet: entry_point_test
// Called by tests and the above function
public static String print(Loader<List<Shift>> shifts, Calendar day)
// end-snippet
{
String template = FileUtils.readFromClassPath(KitchenScheduler.class, "KitchenSchedule.template.md");
String text = VelocityParser.parseString(template, c -> {
c.put("day", day);
c.put("shifts", shifts.load());
});
return text;
}
}