Skip to content

Commit 990dfb5

Browse files
committed
Break out random workspace resource
This will be used in a test.
1 parent 41a19b5 commit 990dfb5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/test/groovy/DataGen.groovy

+9-5
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ class DataGen {
3131
)
3232
}
3333

34-
static Workspace workspace(String name, Map<String, String> agents = [:]) {
35-
UUID wsId = UUID.randomUUID()
36-
UUID ownerId = UUID.randomUUID()
37-
List<WorkspaceResource> resources = agents.collect{ agentName, agentId -> new WorkspaceResource(
34+
static WorkspaceResource resource(String agentName, String agentId){
35+
return new WorkspaceResource(
3836
UUID.randomUUID(), // id
3937
new Date().toInstant(), // created_at
4038
UUID.randomUUID(), // job_id
@@ -70,7 +68,13 @@ class DataGen {
7068
)),
7169
null, // metadata
7270
0, // daily_cost
73-
)}
71+
)
72+
}
73+
74+
static Workspace workspace(String name, Map<String, String> agents = [:]) {
75+
UUID wsId = UUID.randomUUID()
76+
UUID ownerId = UUID.randomUUID()
77+
List<WorkspaceResource> resources = agents.collect{ resource(it.key, it.value)}
7478
return new Workspace(
7579
wsId,
7680
new Date().toInstant(), // created_at

0 commit comments

Comments
 (0)