1818using SpectraLogic . SpectraRioBrokerClient . Calls ;
1919using SpectraLogic . SpectraRioBrokerClient . Exceptions ;
2020using SpectraLogic . SpectraRioBrokerClient . Model ;
21- using SpectraLogic . SpectraRioBrokerClient . Utils ;
2221using System ;
2322using System . Collections ;
2423using System . Collections . Generic ;
@@ -64,9 +63,9 @@ public void ArchiveErrorTests()
6463 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . Archive ( request ) ;
6564 Assert . Fail ( ) ;
6665 } ,
67- new List < UnprocessableError >
66+ new List < ValidationError >
6867 {
69- new UnprocessableError ( "files" , "files" , "no_files_in_job" )
68+ new ValidationError ( "files" , "files" , "no_files_in_job" )
7069 } ) ;
7170
7271 ValidationExceptionCheck (
@@ -79,9 +78,9 @@ public void ArchiveErrorTests()
7978 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . Archive ( request ) ;
8079 Assert . Fail ( ) ;
8180 } ,
82- new List < UnprocessableError >
81+ new List < ValidationError >
8382 {
84- new UnprocessableError ( "files.uri" , "URI" , "invalid_format" , "bad uri" )
83+ new ValidationError ( "files.uri" , "URI" , "invalid_format" , "bad uri" )
8584 } ) ;
8685 }
8786
@@ -118,9 +117,9 @@ public void CreateBrokerErrorTests()
118117 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateBroker ( request ) ;
119118 Assert . Fail ( ) ;
120119 } ,
121- new List < UnprocessableError >
120+ new List < ValidationError >
122121 {
123- new UnprocessableError ( "name" , "string" , "missing" )
122+ new ValidationError ( "name" , "string" , "missing" )
124123 } ) ;
125124
126125 ValidationExceptionCheck (
@@ -130,9 +129,9 @@ public void CreateBrokerErrorTests()
130129 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateBroker ( request ) ;
131130 Assert . Fail ( ) ;
132131 } ,
133- new List < UnprocessableError >
132+ new List < ValidationError >
134133 {
135- new UnprocessableError ( "agentName" , "string" , "missing" )
134+ new ValidationError ( "agentName" , "string" , "missing" )
136135 } ) ;
137136
138137 ValidationExceptionCheck (
@@ -142,9 +141,9 @@ public void CreateBrokerErrorTests()
142141 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateBroker ( request ) ;
143142 Assert . Fail ( ) ;
144143 } ,
145- new List < UnprocessableError >
144+ new List < ValidationError >
146145 {
147- new UnprocessableError ( "agentConfig.blackPearlName" , "string" , "spectra_device_registration_not_found" , "bp_name" )
146+ new ValidationError ( "agentConfig.blackPearlName" , "string" , "spectra_device_registration_not_found" , "bp_name" )
148147 } ) ;
149148
150149 ValidationExceptionCheck (
@@ -154,9 +153,9 @@ public void CreateBrokerErrorTests()
154153 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateBroker ( request ) ;
155154 Assert . Fail ( ) ;
156155 } ,
157- new List < UnprocessableError >
156+ new List < ValidationError >
158157 {
159- new UnprocessableError ( "agentConfig.username" , "string" , "not_found" , "username" )
158+ new ValidationError ( "agentConfig.username" , "string" , "not_found" , "username" )
160159 } ) ;
161160
162161 ValidationExceptionCheck (
@@ -166,9 +165,9 @@ public void CreateBrokerErrorTests()
166165 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateBroker ( request ) ;
167166 Assert . Fail ( ) ;
168167 } ,
169- new List < UnprocessableError >
168+ new List < ValidationError >
170169 {
171- new UnprocessableError ( "agentConfig.bucket" , "string" , "not_found" , "wrong_bucket" )
170+ new ValidationError ( "agentConfig.bucket" , "string" , "not_found" , "wrong_bucket" )
172171 } ) ;
173172 }
174173
@@ -199,9 +198,9 @@ public void CreateDeviceErrorTests()
199198 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateDevice ( request ) ;
200199 Assert . Fail ( ) ;
201200 } ,
202- new List < UnprocessableError >
201+ new List < ValidationError >
203202 {
204- new UnprocessableError ( "name" , "string" , "missing" )
203+ new ValidationError ( "name" , "string" , "missing" )
205204 } ) ;
206205
207206 ValidationExceptionCheck (
@@ -211,9 +210,9 @@ public void CreateDeviceErrorTests()
211210 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateDevice ( request ) ;
212211 Assert . Fail ( ) ;
213212 } ,
214- new List < UnprocessableError >
213+ new List < ValidationError >
215214 {
216- new UnprocessableError ( "mgmtInterface" , "string" , "missing" )
215+ new ValidationError ( "mgmtInterface" , "string" , "missing" )
217216 } ) ;
218217
219218 ValidationExceptionCheck (
@@ -223,9 +222,9 @@ public void CreateDeviceErrorTests()
223222 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateDevice ( request ) ;
224223 Assert . Fail ( ) ;
225224 } ,
226- new List < UnprocessableError >
225+ new List < ValidationError >
227226 {
228- new UnprocessableError ( "mgmtInterface" , "uri" , "invalid_uri" , "bad url" )
227+ new ValidationError ( "mgmtInterface" , "uri" , "invalid_uri" , "bad url" )
229228 } ) ;
230229
231230 ValidationExceptionCheck (
@@ -235,9 +234,9 @@ public void CreateDeviceErrorTests()
235234 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateDevice ( request ) ;
236235 Assert . Fail ( ) ;
237236 } ,
238- new List < UnprocessableError >
237+ new List < ValidationError >
239238 {
240- new UnprocessableError ( "username" , "string" , "missing" )
239+ new ValidationError ( "username" , "string" , "missing" )
241240 } ) ;
242241
243242 ValidationExceptionCheck (
@@ -247,9 +246,9 @@ public void CreateDeviceErrorTests()
247246 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateDevice ( request ) ;
248247 Assert . Fail ( ) ;
249248 } ,
250- new List < UnprocessableError >
249+ new List < ValidationError >
251250 {
252- new UnprocessableError ( "password" , "password" , "missing" )
251+ new ValidationError ( "password" , "password" , "missing" )
253252 } ) ;
254253
255254 ValidationExceptionCheck (
@@ -259,12 +258,12 @@ public void CreateDeviceErrorTests()
259258 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateDevice ( request ) ;
260259 Assert . Fail ( ) ;
261260 } ,
262- new List < UnprocessableError >
261+ new List < ValidationError >
263262 {
264- new UnprocessableError ( "mgmtInterface" , "string" , "missing" ) ,
265- new UnprocessableError ( "username" , "string" , "missing" ) ,
266- new UnprocessableError ( "password" , "password" , "missing" ) ,
267- new UnprocessableError ( "name" , "string" , "missing" ) ,
263+ new ValidationError ( "mgmtInterface" , "string" , "missing" ) ,
264+ new ValidationError ( "username" , "string" , "missing" ) ,
265+ new ValidationError ( "password" , "password" , "missing" ) ,
266+ new ValidationError ( "name" , "string" , "missing" ) ,
268267 } ) ;
269268
270269 ValidationExceptionCheck (
@@ -274,10 +273,10 @@ public void CreateDeviceErrorTests()
274273 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateDevice ( request ) ;
275274 Assert . Fail ( ) ;
276275 } ,
277- new List < UnprocessableError >
276+ new List < ValidationError >
278277 {
279- new UnprocessableError ( "username" , "string" , "invalid_credentials" ) ,
280- new UnprocessableError ( "password" , "password" , "invalid_credentials" )
278+ new ValidationError ( "username" , "string" , "invalid_credentials" ) ,
279+ new ValidationError ( "password" , "password" , "invalid_credentials" )
281280 } ) ;
282281
283282 ValidationExceptionCheck (
@@ -287,10 +286,10 @@ public void CreateDeviceErrorTests()
287286 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateDevice ( request ) ;
288287 Assert . Fail ( ) ;
289288 } ,
290- new List < UnprocessableError >
289+ new List < ValidationError >
291290 {
292- new UnprocessableError ( "username" , "string" , "invalid_credentials" ) ,
293- new UnprocessableError ( "password" , "password" , "invalid_credentials" )
291+ new ValidationError ( "username" , "string" , "invalid_credentials" ) ,
292+ new ValidationError ( "password" , "password" , "invalid_credentials" )
294293 } ) ;
295294
296295 ValidationExceptionCheck (
@@ -300,9 +299,9 @@ public void CreateDeviceErrorTests()
300299 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateDevice ( request ) ;
301300 Assert . Fail ( ) ;
302301 } ,
303- new List < UnprocessableError >
302+ new List < ValidationError >
304303 {
305- new UnprocessableError ( "mgmtInterface" , "uri" , "data_interface_specified" )
304+ new ValidationError ( "mgmtInterface" , "uri" , "data_interface_specified" )
306305 } ) ;
307306 }
308307
@@ -349,9 +348,9 @@ public void CreateTokenErrorTests()
349348 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateToken ( request ) ;
350349 Assert . Fail ( ) ;
351350 } ,
352- new List < UnprocessableError >
351+ new List < ValidationError >
353352 {
354- new UnprocessableError ( "username" , "string" , "missing" , reason : "username cannot be empty" )
353+ new ValidationError ( "username" , "string" , "missing" , reason : "username cannot be empty" )
355354 } ) ;
356355
357356 ValidationExceptionCheck (
@@ -361,9 +360,9 @@ public void CreateTokenErrorTests()
361360 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . CreateToken ( request ) ;
362361 Assert . Fail ( ) ;
363362 } ,
364- new List < UnprocessableError >
363+ new List < ValidationError >
365364 {
366- new UnprocessableError ( "password" , "string" , "missing" , reason : "password cannot be empty" )
365+ new ValidationError ( "password" , "string" , "missing" , reason : "password cannot be empty" )
367366 } ) ;
368367 }
369368
@@ -698,9 +697,9 @@ public void RestoreErrorTests()
698697 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . Restore ( request ) ;
699698 Assert . Fail ( ) ;
700699 } ,
701- new List < UnprocessableError >
700+ new List < ValidationError >
702701 {
703- new UnprocessableError ( "files" , "files" , "no_files_in_job" )
702+ new ValidationError ( "files" , "files" , "no_files_in_job" )
704703 } ) ;
705704
706705 ValidationExceptionCheck (
@@ -713,9 +712,9 @@ public void RestoreErrorTests()
713712 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . Restore ( request ) ;
714713 Assert . Fail ( ) ;
715714 } ,
716- new List < UnprocessableError >
715+ new List < ValidationError >
717716 {
718- new UnprocessableError ( "files.uri" , "URI" , "invalid_format" , "bad uri" ) ,
717+ new ValidationError ( "files.uri" , "URI" , "invalid_format" , "bad uri" ) ,
719718 } ) ;
720719
721720 ValidationExceptionCheck (
@@ -728,9 +727,9 @@ public void RestoreErrorTests()
728727 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . Restore ( request ) ;
729728 Assert . Fail ( ) ;
730729 } ,
731- new List < UnprocessableError >
730+ new List < ValidationError >
732731 {
733- new UnprocessableError ( "files.byteRange" , "object" , "invalid" , reason : "The startingIndex must be positive" ) ,
732+ new ValidationError ( "files.byteRange" , "object" , "invalid" , reason : "The startingIndex must be positive" ) ,
734733 } ) ;
735734
736735 ValidationExceptionCheck (
@@ -743,9 +742,9 @@ public void RestoreErrorTests()
743742 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . Restore ( request ) ;
744743 Assert . Fail ( ) ;
745744 } ,
746- new List < UnprocessableError >
745+ new List < ValidationError >
747746 {
748- new UnprocessableError ( "files.byteRange" , "object" , "invalid" , reason : "The endingIndex must be positive" ) ,
747+ new ValidationError ( "files.byteRange" , "object" , "invalid" , reason : "The endingIndex must be positive" ) ,
749748 } ) ;
750749
751750 ValidationExceptionCheck (
@@ -758,9 +757,9 @@ public void RestoreErrorTests()
758757 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . Restore ( request ) ;
759758 Assert . Fail ( ) ;
760759 } ,
761- new List < UnprocessableError >
760+ new List < ValidationError >
762761 {
763- new UnprocessableError ( "files.byteRange" , "object" , "invalid" , reason : "startingIndex must be lower than endingIndex" ) ,
762+ new ValidationError ( "files.byteRange" , "object" , "invalid" , reason : "startingIndex must be lower than endingIndex" ) ,
764763 } ) ;
765764 }
766765
@@ -823,9 +822,9 @@ public void RestoreJobWithIgnoreDuplicatesErrorTests()
823822 SpectraRioBrokerClientFixture . SpectraRioBrokerClient . Restore ( restoreRequest ) ;
824823 Assert . Fail ( ) ;
825824 } ,
826- new List < UnprocessableError >
825+ new List < ValidationError >
827826 {
828- new UnprocessableError ( fileName1 , "file" , "duplicate_file_brokers" ) ,
827+ new ValidationError ( fileName1 , "file" , "duplicate_file_brokers" ) ,
829828 } ) ;
830829
831830 var deleteF1Request = new DeleteFileRequest ( SpectraRioBrokerClientFixture . BrokerName , fileName1 ) ;
@@ -884,8 +883,7 @@ private void ValidationExceptionCheck(Action action, IEnumerable expected)
884883 }
885884 catch ( ValidationException ex )
886885 {
887- var unprocessableErrorResponse = ex . ExtractUnprocessableErrorResponse ( ) ;
888- CollectionAssert . AreEqual ( expected , unprocessableErrorResponse . Errors , new UnprocessableErrorComparer ( ) ) ;
886+ CollectionAssert . AreEqual ( expected , ex . ValidationErrors , new ValidationErrorComparer ( ) ) ;
889887 }
890888 }
891889
0 commit comments