@@ -19,15 +19,35 @@ private JobResponse loadJob(String filePath) throws IOException {
1919 }
2020
2121 @ Nested
22- @ DisplayName ("When the Job is OK " )
23- class OkTest {
22+ @ DisplayName ("When the Job is processing " )
23+ class ProcessingTest {
2424 @ Test
2525 @ DisplayName ("properties must be valid" )
2626 void whenProcessing_mustHaveValidProperties () throws IOException {
2727 JobResponse response = loadJob ("job/ok_processing.json" );
2828 Job job = response .getJob ();
2929 assertNotNull (job );
3030 assertEquals ("Processing" , job .getStatus ());
31+ assertNotNull (job .getCreatedAt ());
32+ assertNull (job .getCompletedAt ());
33+ assertNull (job .getResultUrl ());
34+ assertNull (job .getError ());
35+ }
36+ }
37+
38+ @ Nested
39+ @ DisplayName ("When the Job is processed" )
40+ class ProcessedTest {
41+ @ Test
42+ @ DisplayName ("properties must be valid" )
43+ void whenProcessing_mustHaveValidProperties () throws IOException {
44+ JobResponse response = loadJob ("job/ok_processed_webhooks_ok.json" );
45+ Job job = response .getJob ();
46+ assertNotNull (job );
47+ assertEquals ("Processed" , job .getStatus ());
48+ assertNotNull (job .getCreatedAt ());
49+ assertNotNull (job .getCompletedAt ());
50+ assertNotNull (job .getResultUrl ());
3151 assertNull (job .getError ());
3252 }
3353 }
@@ -41,6 +61,9 @@ void when422_mustHaveValidProperties() throws IOException {
4161 JobResponse response = loadJob ("job/fail_422.json" );
4262 Job job = response .getJob ();
4363 assertNotNull (job );
64+ assertNotNull (job .getCreatedAt ());
65+ assertNotNull (job .getCompletedAt ());
66+ assertNull (job .getResultUrl ());
4467 ErrorResponse jobError = job .getError ();
4568 assertNotNull (jobError );
4669 assertEquals (422 , jobError .getStatus ());
0 commit comments