33import static org .junit .jupiter .api .Assertions .*;
44
55import com .databricks .sdk .WorkspaceClient ;
6+ import com .databricks .sdk .core .error .platform .InvalidParameterValue ;
67import com .databricks .sdk .core .error .platform .ResourceDoesNotExist ;
78import com .databricks .sdk .integration .framework .CollectionUtils ;
89import com .databricks .sdk .integration .framework .EnvContext ;
910import com .databricks .sdk .integration .framework .EnvTest ;
10- import com .databricks .sdk .service .jobs .BaseJob ;
11- import com .databricks .sdk .service .jobs .ListJobsRequest ;
11+ import com .databricks .sdk .service .jobs .*;
1212import org .junit .jupiter .api .Test ;
1313import org .junit .jupiter .api .extension .ExtendWith ;
1414
@@ -32,4 +32,112 @@ void getNonExistingJob(WorkspaceClient w) {
3232 w .jobs ().get (123456789 );
3333 });
3434 }
35+
36+ @ Test
37+ void deleteNonExistingJob (WorkspaceClient w ) {
38+ assertThrowsExactly (
39+ InvalidParameterValue .class ,
40+ () -> {
41+ w .jobs ().delete (123456789 );
42+ });
43+ }
44+
45+ @ Test
46+ void resetNonExistingJob (WorkspaceClient w ) {
47+ assertThrowsExactly (
48+ InvalidParameterValue .class ,
49+ () -> {
50+ w .jobs ().reset (123456789 , new JobSettings ());
51+ });
52+ }
53+
54+ @ Test
55+ void updateNonExistingJob (WorkspaceClient w ) {
56+ assertThrowsExactly (
57+ InvalidParameterValue .class ,
58+ () -> {
59+ w .jobs ().update (123456789 );
60+ });
61+ }
62+
63+ @ Test
64+ void runNonExistingJob (WorkspaceClient w ) {
65+ assertThrowsExactly (
66+ InvalidParameterValue .class ,
67+ () -> {
68+ w .jobs ().runNow (123456789 );
69+ });
70+ }
71+
72+ @ Test
73+ void listsRuns (WorkspaceClient w ) {
74+ Iterable <BaseRun > list = w .jobs ().listRuns (new ListRunsRequest ());
75+
76+ java .util .List <BaseRun > all = CollectionUtils .asList (list );
77+
78+ CollectionUtils .assertUnique (all );
79+ }
80+
81+ @ Test
82+ void getNonExistingRun (WorkspaceClient w ) {
83+ assertThrowsExactly (
84+ InvalidParameterValue .class ,
85+ () -> {
86+ w .jobs ().getRun (123456789 );
87+ });
88+ }
89+
90+ @ Test
91+ void getOutputOfNonExistingRun (WorkspaceClient w ) {
92+ assertThrowsExactly (
93+ InvalidParameterValue .class ,
94+ () -> {
95+ w .jobs ().getRunOutput (123456789 );
96+ });
97+ }
98+
99+ @ Test
100+ void deleteNonExistingRun (WorkspaceClient w ) {
101+ assertThrowsExactly (
102+ InvalidParameterValue .class ,
103+ () -> {
104+ w .jobs ().deleteRun (123456789 );
105+ });
106+ }
107+
108+ @ Test
109+ void exportNonExistingRun (WorkspaceClient w ) {
110+ assertThrowsExactly (
111+ InvalidParameterValue .class ,
112+ () -> {
113+ w .jobs ().exportRun (123456789 );
114+ });
115+ }
116+
117+ @ Test
118+ void cancelingNonExistingRun (WorkspaceClient w ) {
119+ assertThrowsExactly (
120+ InvalidParameterValue .class ,
121+ () -> {
122+ w .jobs ().cancelRun (123456789 );
123+ });
124+ }
125+
126+ @ Test
127+ void cancelingAllRunsFromNonExistingJob (WorkspaceClient w ) {
128+ assertThrowsExactly (
129+ InvalidParameterValue .class ,
130+ () -> {
131+ w .jobs ().cancelAllRuns (new CancelAllRuns ().setJobId (123456789L ));
132+ });
133+ }
134+
135+ @ Test
136+ void repairingANonExistingRun (WorkspaceClient w ) {
137+ assertThrowsExactly (
138+ InvalidParameterValue .class ,
139+ () -> {
140+ w .jobs ().repairRun (123456789 );
141+ });
142+ }
35143}
0 commit comments