@@ -139,6 +139,77 @@ public function testPhaseJobSucceededWithWarningSubscription(): void
139139 );
140140 }
141141
142+ public function testJobSucceededSubscription (): void
143+ {
144+ $ subscriptionRequest = new Subscription (
145+ 'job-succeeded ' ,
146+ new EmailRecipient ('john.doe@example.com ' ),
147+ [
148+ new Filter ('job.component.id ' , 'my.component ' ),
149+ new Filter ('job.configuration.id ' , '12345 ' ),
150+ ]
151+ );
152+
153+ self ::assertSame (
154+ [
155+ 'event ' => 'job-succeeded ' ,
156+ 'filters ' => [
157+ [
158+ 'field ' => 'job.component.id ' ,
159+ 'value ' => 'my.component ' ,
160+ ],
161+ [
162+ 'field ' => 'job.configuration.id ' ,
163+ 'value ' => '12345 ' ,
164+ ],
165+ ],
166+ 'recipient ' => [
167+ 'channel ' => 'email ' ,
168+ 'address ' => 'john.doe@example.com ' ,
169+ ],
170+ ],
171+ $ subscriptionRequest ->jsonSerialize ()
172+ );
173+ }
174+
175+ public function testPhaseJobSucceededSubscription (): void
176+ {
177+ $ subscriptionRequest = new Subscription (
178+ 'phase-job-succeeded ' ,
179+ new EmailRecipient ('john.doe@example.com ' ),
180+ [
181+ new Filter ('job.component.id ' , 'my.component ' ),
182+ new Filter ('job.configuration.id ' , '12345 ' ),
183+ new Filter ('phase.id ' , '123 ' ),
184+ ]
185+ );
186+
187+ self ::assertSame (
188+ [
189+ 'event ' => 'phase-job-succeeded ' ,
190+ 'filters ' => [
191+ [
192+ 'field ' => 'job.component.id ' ,
193+ 'value ' => 'my.component ' ,
194+ ],
195+ [
196+ 'field ' => 'job.configuration.id ' ,
197+ 'value ' => '12345 ' ,
198+ ],
199+ [
200+ 'field ' => 'phase.id ' ,
201+ 'value ' => '123 ' ,
202+ ],
203+ ],
204+ 'recipient ' => [
205+ 'channel ' => 'email ' ,
206+ 'address ' => 'john.doe@example.com ' ,
207+ ],
208+ ],
209+ $ subscriptionRequest ->jsonSerialize ()
210+ );
211+ }
212+
142213 public function testPhaseJobProcessingLongSubscription (): void
143214 {
144215 $ subscriptionRequest = new Subscription (
0 commit comments