Skip to content

Commit 2cb7dd7

Browse files
committed
Setup factory
1 parent 82ddba2 commit 2cb7dd7

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
FactoryBot.define do
2+
factory :oxbow_job_id, class: String do
3+
Id { "1234/5678/2025-12-17T15:00Z/2025-12-17T16:00Z/27a8112d-b582-4d23-8d73-257e543d64a4.mp3" }
4+
initialize_with { attributes.with_indifferent_access }
5+
end
6+
7+
factory :oxbow_job_received, class: Hash do
8+
Time { "2025-12-17T14:51:16.490Z" }
9+
Timestamp { 1765983076.49 }
10+
JobReceived do
11+
Job { build(:oxbow_job_id) }
12+
Execution { {Id: "arn:aws:states:the-execution-arn"} }
13+
State "RECEIVED"
14+
end
15+
initialize_with { attributes.with_indifferent_access }
16+
end
17+
18+
factory :oxbow_ffmpeg_destination, class: Hash do
19+
Mode { "AWS/S3" }
20+
BucketName { "prx-feed-testing" }
21+
ObjectKey { "1234/5678/2025-12-17T15:00Z/2025-12-17T16:00Z/27a8112d-b582-4d23-8d73-257e543d64a4.mp3" }
22+
initialize_with { attributes.with_indifferent_access }
23+
end
24+
25+
factory :oxbow_ffmpeg_task, class: Hash do
26+
Type { "FFmpeg" }
27+
FFmpeg do
28+
Inputs { "-t 4350 -i \"http://some.stream/url/stream_name.mp3\"" }
29+
GlobalOptions { "" }
30+
InputFileOptions { "" }
31+
OutputFileOptions { "" }
32+
Outputs { [{Format: "mp3", Destination: build(:oxbow_ffmpeg_destination)}] }
33+
end
34+
initialize_with { attributes.with_indifferent_access }
35+
end
36+
37+
factory :oxbow_ffmpeg_result, class: Hash do
38+
Task { "FFmpeg" }
39+
Time { "2025-12-17T16:02:23.826Z" }
40+
Timestamp { 1765987343.826 }
41+
FFmpeg do
42+
Outputs do
43+
[
44+
Mode: "AWS/S3",
45+
BucketName: "prx-feed-testing",
46+
ObjectKey: "1234/5678/2025-12-17T15:00Z/2025-12-17T16:00Z/27a8112d-b582-4d23-8d73-257e543d64a4.mp3",
47+
Duration: 4350000,
48+
Size: 12345678
49+
]
50+
end
51+
end
52+
initialize_with { attributes.with_indifferent_access }
53+
end
54+
55+
factory :oxbow_task_result, class: Hash do
56+
Time { "2025-12-17T16:02:23.210Z" }
57+
Timestamp { 1765987343.21 }
58+
Task { build(:oxbow_ffmpeg_task) }
59+
TaskResult do
60+
Job { build(:oxbow_job_id) }
61+
Execution { {Id: "arn:aws:states:the-execution-arn"} }
62+
Result build(:oxbow_ffmpeg_result)
63+
end
64+
initialize_with { attributes.with_indifferent_access }
65+
end
66+
67+
factory :oxbow_job_results, class: Hash do
68+
Time { "2025-12-17T16:02:23.826Z" }
69+
Timestamp { 1765987343.826 }
70+
JobResult do
71+
Job { build(:oxbow_job_id) }
72+
Execution { {Id: "arn:aws:states:the-execution-arn"} }
73+
State { "DONE" }
74+
FailedTasks { [] }
75+
TaskResults { [build(:oxbow_ffmpeg_result)] }
76+
end
77+
initialize_with { attributes.with_indifferent_access }
78+
end
79+
end

0 commit comments

Comments
 (0)